Wood David wrote:
However, is it really true that a floating point 0.0 isn't always all zero bytes?
In IEEE floating-point arthmetic "each floating point format (single, double and extended) has two representations for zero: +0 and -0. The two zeros compare as equal: +0= -0; however, their behaviors in the arithmetic are slightly different."
As the bit patterns for +0.0 and -0.0 must be different to distinguish between them, the answer to your question can only be "yes". Nevertheless, with IEEE floating-point formats a sequence of zero-bits will produce number +0.0.
I don’t know if all platforms follow the IEEE-standard. You can test yourself easily. While writing such a test, I ran into an internal compiler error.
program zero; type int64 = integer( 64); var r: double; l: int64; begin l:= 0; int64( r):=l; writeln( 'r = ', r); r:= -1; double( l):= r; writeln( 'l = ', l) end.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -o zero zero.pas zero.pas: In main program: zero.pas:1: Internal compiler error in convert_move, at expr.c:507 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions.