August 13, 2014
On Wednesday, 13 August 2014 at 07:58:40 UTC, Nordlöw wrote:
>     {
>         float x = 1.23e10;
>         auto y = *cast(FloatRep*)(&x);
>         writeln(y.fraction, ", ",
>                 y.exponent, ", ",
>                 y.sign);
>     }
>
>     {
>         double x = 1.23e10;
>         auto y = *cast(DoubleRep*)(&x);
>         writeln(y.fraction, ", ",
>                 y.exponent, ", ",
>                 y.sign);
>     }
> }

It would be nice to turn these into either

- properties or at least
- template overloads

if possible as pointer casting unsafe and error-prone.
1 2
Next ›   Last »