[fpc-pascal] License question; unit to view floating-point details
Adriaan van Os
fpc at microbizz.nl
Sat Sep 6 11:14:32 CEST 2008
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
More information about the fpc-pascal
mailing list