wxArt2D
|
Public Attributes | |
union { | |
wxByte by [sizeof(wxFloat64)/sizeof(wxByte)] | |
wxUint32 fl [sizeof(wxFloat64)/sizeof(wxUint32)] | |
wxFloat64 machdb | |
}; | |
PC double union
To convert GDSII doubles to machine doubles : void gds_double( fb)
To convert machine doubles to GDSII doubles : void double_gds( fb)
GDSII floating point representation (8-byte REAL)
SEEEEEEE MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM
Sign = S=1 negatif S=0 positif Expo = (E-64)^16 Mantisse = (1/16 <= M < 1) Double value = (-1)^S * Expo * Mantisse Zero = all bits of M zero
unix (Apollo) or wxBIG_ENDIAN (8-byte REAL)
SEEEEEEE EEEEMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM
Sign = S=1 negatif S=0 positif Expo = (E-1023)^2 Mantisse = (1.M)binary Double value = (-1)^S * Expo * Mantisse Zero = E=0 and M=0 +-Infinit = E=2047 and M=0
notice: a wxUint32 in turbo C = in memory for instance like this m=40 m+1=99 m+2=94 m+3=93
then (long) & 0xFF000000 gives the result m=40 m+1=99 m+2=94 m+3=00
in most other machine this is m=00 m+1=99 m+2=94 m+3=93
all of this is due to that the bytes of types are in reverse order in memory.