Menu of Filip Rooms' site
Home Sourcecode CV Favorite Links All Links Notes Pictures
Valid HTML 4.01!
Valid CSS!
Free Software Magazine
Free Software Daily

Data type ranges (order of magnitude)

CPP file, prints data ranges for different data types. Compile with g++ Printlimits.cpp -o Printlimits -lm

Integers

Found in /usr/include/limits.h Source

Bitsrange signedUnsigned
8-128 to +1270 to +255
16-32.768 to +32.7670 to +65.535
32-2,14e9 to +2,14e90 to +4,3e9
64-9,22e18 to +9,22e180 to +18,44e18

Floating types

On Ubuntu (64 bit) float.h is located in /usr/lib/gcc/x86_64-linux-gnu/4.2/include

Useful functions:

Type Min Max epsilon
Float 1.17549e-38 3.40282e+38 1.19209e-07
Double 2.22507e-308 1.79769e+308 2.22045e-16