Bitfield structs and suggestion

Miles _______ at _______.____
Tue Mar 21 14:14:56 PST 2006


Don Clugston wrote:
> Maybe only the mantissa and exponent are required, the position of the
> negative bit is fixed in the exponent, isn't it?
> (provided that mantissa is an integral type).

I don't think so. The negative bit is not part of the exponent, it is
really a separate field. Perhaps you are thinking about the signalling
NaN indicator, that is the highest bit of the mantissa.

But sure would be appropriate, with a little overhead, to have better
cooked .exponent and .mantissa properties. Only that the user wouldn't
be able to detect a negative zero.

> Immediate interesting application: efficiently converting random
> integers into a random real in the range 0..1, just by storing the int
> into the mantissa of a real.

Sure!

Too bad Walter didn't seem to notice my previous post.

Best regards.



More information about the Digitalmars-d mailing list