Skip to content

TDoubleHelper

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Helper for Double floating point type

Declaration

Source position: syshelph.inc line 263

Type
  TDoubleHelper = type helper type for Double
  private
    function GetB(AIndex: Cardinal) : Byte;
    function GetW(AIndex: Cardinal) : Word;
    function GetE : QWord;
    function GetF : QWord;
    function GetS : Boolean;
    procedure SetB(AIndex: Cardinal; const AValue: Byte);
    procedure SetW(AIndex: Cardinal; const AValue: Word);
    procedure SetE(AValue: QWord);
    procedure SetF(AValue: QWord);
    procedure SetS(AValue: Boolean);
  public
    Epsilon : Double = 4.9406564584124654418e-324;
    MaxValue : Double = 1.7976931348623157081e+308;
    MinValue : Double = - 1.7976931348623157081e+308;
    PositiveInfinity : Double = 1.0 / 0.0;
    NegativeInfinity : Double = (- 1.0) / (0.0);
    NaN : Double = 0.0 / 0.0;
    class function IsInfinity(const AValue: Double) : Boolean;  Overload
                             ;  Static;
    function IsInfinity : Boolean;  Overload;
    class function IsNan(const AValue: Double) : Boolean;  Overload;  Static;
    function IsNan : Boolean;  Overload;
    class function IsNegativeInfinity(const AValue: Double) : Boolean
                                     ;  Overload;  Static;
    function IsNegativeInfinity : Boolean;  Overload;
    class function IsPositiveInfinity(const AValue: Double) : Boolean
                                     ;  Overload;  Static;
    function IsPositiveInfinity : Boolean;  Overload;
    class function Parse(const AString: string) : Double;  Overload;  Static;
    class function Parse(const AString: string; 
                        const AFormatSettings: TFormatSettings) : Double
                        ;  Overload;  Static;
    class function Size : Integer;  Static;
    class function ToString(const AValue: Double) : string;  Overload
                           ;  Static;
    class function ToString(const AValue: Double; 
                           const AFormat: TFloatFormat; 
                           const APrecision: Integer; 
                           const ADigits: Integer) : string;  Overload
                           ;  Static;
    class function ToString(const AValue: Double; 
                           const AFormat: TFloatFormat; 
                           const APrecision: Integer; 
                           const ADigits: Integer; 
                           const AFormatSettings: TFormatSettings) : string
                           ;  Overload;  Static;
    class function ToString(const AValue: Double; 
                           const AFormatSettings: TFormatSettings) : string
                           ;  Overload;  Static;
    function ToString(const AFormat: TFloatFormat; 
                     const APrecision: Integer; const ADigits: Integer)
                      : string;  Overload;
    function ToString(const AFormat: TFloatFormat; 
                     const APrecision: Integer; const ADigits: Integer; 
                     const AFormatSettings: TFormatSettings) : string
                     ;  Overload;
    function ToString(const AFormatSettings: TFormatSettings) : string
                     ;  Overload;
    function ToString : string;  Overload;
    class function TryParse(const AString: string; out AValue: Double)
                            : Boolean;  Overload;  Static;
    class function TryParse(const AString: string; out AValue: Double; 
                           const AFormatSettings: TFormatSettings) : Boolean
                           ;  Overload;  Static;
    procedure BuildUp(const ASignFlag: Boolean; const AMantissa: QWord; 
                     const AExponent: Integer);
    function Exponent : Integer;
    function Fraction : Extended;
    function Mantissa : QWord;
    function SpecialType : TFloatSpecial;
    Bytes[AIndex: Cardinal]: Byte;
    Words[AIndex: Cardinal]: Word;
    Sign : Boolean;
    Exp : QWord;
    Frac : QWord;
  end
  ;

Description

TDoubleHelper is the helper type for the Double-sized floating point type. It contains some conversion methods, as well as access to the low-level structure of the floating-point representation of a Double.

Members

Member Type Visibility Description
BuildUp Method public Build a Double-sized floating point from its composing parts
Bytes Property public Indexed access to the individual bytes of the floating point value
Epsilon Constant public Precision for this floating point type
Exp Property public The bit pattern of the exponent as stored in memory.
Exponent Method public Exponent of the floating-point value
Frac Property public Bitpattern that makes up the fractional part.
Fraction Method public Fraction of the floating-point value
GetB Method private
GetE Method private
GetF Method private
GetS Method private
GetW Method private
IsInfinity Method public Check whether a value is positive or negative infinity.
IsNan Method public Check whether a value equals NaN.
IsNegativeInfinity Method public Check whether a value is negative infinity.
IsPositiveInfinity Method public Check whether a value is positive infinity.
Mantissa Method public Mantissa of the floating-point
MaxValue Constant public Largest possible value for the Double floating point type
MinValue Constant public Smallest (negative) possible value for the Double floating point type
NaN Constant public Representation of NaN (Not a Number)
NegativeInfinity Constant public Negative infinity as represented by a Double floating point type
Parse Method public Convert a string to a floating point value
PositiveInfinity Constant public Positive infinity as represented by a Double floating point type
SetB Method private
SetE Method private
SetF Method private
SetS Method private
SetW Method private
Sign Property public Sign of the floating point value
Size Method public Size (in bytes) of a Double-sized floating point value.
SpecialType Method public Return the type of the Double-sized floating point value
ToString Method public Convert a Double-sized floating point value to a string
TryParse Method public Try to convert a string to a Double-sized floating point value.
Words Property public Indexed access to the words that make up the floating point value

Inheritance

Class Description
TDoubleHelper Helper for Double floating point type

See also

Name Description
Byte An unsigned 8-bits integer
QWord 64-bit unsigned integer
QWord 64-bit unsigned integer
TDoubleHelper Helper for Double floating point type
TExtendedHelper Helper for Extended floating point type
Word An unsigned 16-bits integer