Unanswerable question?

Blitz3D Forums/Blitz3D Programming/Unanswerable question?

I don't have the Blitz manuals on this machine, and the online versions do not seem to discuss internal representation of numbers, but...

There are three issues here:
(1) how the compiler converts commands and variables into code to run on the cpu (i.e. machine code)
(2) how the actual Arithmetic Logic Unit processes the values and stores them in RAM
(3) how Blitz commands to display the stored value will report back
Most floating point representations can be likened 
to 'scientific notation' or 'exponential form' where a 
value like 2.3 x 10^3 is equivalent to 2300 and 2.3 x 10^-1 
is equivalent to 0.23

The float will be made up of a number of bits.... let's 
say 16 bits for illustration purposes. The compiler could 
then be forced to treat these as an 8 bit mantissa (the 
value part) and an 8 bit exponent (the size part). 
In this case we can have 256 different 'values' and a range of 
256 'sizes'. Having to have a 'sign bit' for each of these 
would reduce it to 127 values and powers in the range -64 
to +64.

...Of course this is just one setup. Depending 
on 'typical' values required we might go with a 12 bit 
mantissa and a 4 bit exponent. (Again allowing for sign 
bits) this would allow a range of 2048 values and powers 
in the range -4 to +4.


In reality I assume Blitz floats are 32 bit numbers, with a fairly decent resolving power (i.e. range of values) and scope (i.e. range of powers). However... the functions that convert a value to something that the text commands can handle will truncate or round off the real, internal value.

So arguements about 'digit accuracy' really only apply to attempts to display the value - they are related to, but not exactly the same as arguements about the representation of the value. Of course 'displaying' applies as much to positioning routines as textouts, so any advice about avoiding problems with floating point innacuracies due to scale differences should be taken into consideration.

Just thought I would post this to save someone getting hung up on exact definitions of Blitz ranges based on what gets reported on screen !