ExtractParts Procedure
Returns an Extended as its Mantissa and Exponent base 10.

Unit
QESBPCSMath

Declaration
Procedure ExtractParts(const X: Extended; out Mantissa: Extended; out Exponent: Integer);

Description
For Values with large negative exponents, ESBTolerance will need to be changed to a smaller value.

Parameters
Float to process
Mantissa Resultant Mantissa in the form x.yyyyyyy.
Exponent Resultant Exponent of the float, ie power of 10.

Category
Arithmetic Routines for Floats

Implementation

procedure ExtractParts (const X: Extended; out Mantissa: Extended;
     out Exponent: Integer);
begin
     if FloatIsZero (X) then
     begin
          Exponent := 0;
          Mantissa := 0;
     end
     else
     begin
          Exponent := Round (ESBFloor (ESBLog10 (abs (X))));
          Mantissa := X / TenToY (Exponent);
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com