Tom Verhoeff wrote:
Would there be any interest in incorporating it?
Here are the supported operations (for Single; a similar set exists
for Double):
function SingleToStrBits ( const x: Single ): String;
{ returns string with bits for sign, biased exponent, and fraction }
function SingleToStrBinary ( const x: Single ): String;
{ returns string with binary scientific representation of x:
NaN, +/-Infinity, +/-B.B___Bd+/-E, where
'B' is a bit, 'd' stands for '*2^' and 'E' is the exponent in decimal }
function PowerOf2Single ( const x: Single; n: Integer ): Single;
{ returns x * 2 ^ n }
procedure FlipBitSingle ( var x: Single; i: BitIndexSingle );
{ flips bit i of x }
function SuccSingle ( const x: Single): Single;
{ returns successor of x }
function PredSingle ( const x: Single): Single;
{ returns predecessor of x }
Looks interesting.
Regards,
Adriaan van Os
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal