Compile time float binary representation

Jeremie Pelletier jeremiep at gmail.com
Fri Jul 31 18:45:12 PDT 2009


Is there a way to convert a float (or double/real) to an integral number without changing its binary representation at compile time?

I need to extract the sign, exponent and mantissa yet I cant use bit shifting.
"Error: 'R' is not of integral type, it is a real" is the error I get.

The usual *cast(uint*)&value wont work either at compile time.

Any suggestions?



More information about the Digitalmars-d mailing list