float

Blitz3D Forums/Blitz3D Programming/float

LostCargo(Posted 2003) [#1]
Alright. Here is an attempt to get a definitive answer.
I know that integers need to be within the range -2147483648 to +2147483647.
But what about the floats.. what is the range in blitz. I know that there is a standard upper and lower bounds, but the documentation in blitz does not state this.

Any takers?


Floyd(Posted 2003) [#2]
The largest float could be represented as a 128-bit integer consisting of
24 ones followed by 104 zeroes.

N = (2^24) - 1 in base two is 24 ones. So the largest float is

N * (2^104), i.e. N with another 104 zeroes on the end.

In base ten that's about 3.402823466e38.

The 'most negative float' is the same number times -1.

Here's the relevant #define from FLOAT.H for Visual C++
#define FLT_MAX         3.402823466e+38F



LostCargo(Posted 2003) [#3]
thx floyd


myspys(Posted 2003) [#4]
in another thread mark said that blitz only stores 6 decimals..

can't find the thread now, but a similar one is at
http://www.blitzbasic.com/bbs/posts.php?topic=9385