Null references redux
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Mon Sep 28 03:14:55 PDT 2009
Jeremie Pelletier wrote:
> Nick Sabalausky wrote:
>> union A {
>> int foo;
>> float bar;
>> }
>>
>
> Yet it's the only way I know of to do bitwise logic on floating points
> in D to extract the exponent, sign and mantissa for example.
You could add built-in methods for those operations to the float type:
float bar;
boolean s = bar.sign;
...
Union is very flexible, but unfortunately it's also one of the features that
can break the type safety in D.
More information about the Digitalmars-d
mailing list