On Tue, Jul 16, 2013 at 12:04:08AM +1000, Daniel Murphy wrote:
> I would prefer to see (as either builtins or properties) a way to
> get/set the exponent/mantissa/sign of a float.
> 
> eg
> float x;
> x.sign = 1;
> assert(x.exp == 123);
> 
> Easily ctfeable, no need for casting, no endianness problems.
[...]

+1. IMO this is the right way to handle floating-point attributes.
Direct knowledge about the binary representation should be restricted to
the compiler as much as possible. Plus, having these attributes could
potentially be useful in other contexts than std.math.


T

-- 
The best way to destroy a cause is to defend it poorly.
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to