Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C is shit

Name: Anonymous 2011-11-30 19:50

Why have short and int if by the standard they end up being the same size number of bits.


Is the following correct:

char        => 8 bits
short       => 16 bits
int         => 16 bits
long        => 32 bits
long long   => 64 bits

float       => 32 bits
double      => 64 bits
long double => 128 bits


whats the point of short?

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-02 1:38

>>33
Storing boolean as Ints is fine, we have the hard disk space,
using double instead of ints is acceptable, with very low performance loss(FPUs) well below ~10 cycles,
Casting Double to Int and Back to satisfy a type model will cost up to 200 cycles.
Using software Arbitrary precision types is going to cost you thousands or hundreds of thousands of cycles.
Using arbitrary precision integer arithmetic will cost real milliseconds to a several seconds(depends on size).
Using arbitrary precision floating point arithmetic will cost dozens of milliseconds up to minute(which would start to get noticeable with high precision).
So how "Variable type doesn't mean shit anymore"?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List