Data.FmtBcd.TBcd

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

  TBcd  = record
    Precision: Byte;                        { 1..64 }
    SignSpecialPlaces: Byte;                { Sign:1, Special:1, Places:6 }
    Fraction: packed array [0..31] of Byte; { BCD Nibbles, 00..99 per Byte, high Nibble 1st }
    class operator Implicit(const str: string): TBcd;
    class operator Implicit(const d: double): TBcd;
    class operator Implicit(const I: Integer): TBcd;
    class operator Explicit(const ABcd: TBcd): string;
    class operator Explicit(const ABcd: TBcd): Integer;
    class operator Add(const A, B: TBcd): TBcd;
    class operator Subtract(const A, B: TBcd): TBcd;
    class operator Multiply(const A, B: TBcd): TBcd;
    class operator Divide(const A, B: TBcd): TBcd;
    class operator Negative(const A: TBcd): TBcd;
    class operator Equal(const A, B: TBcd): Boolean;
    class operator NotEqual(const A, B: TBcd): Boolean;
    class operator GreaterThan(const A, B: TBcd): Boolean;
    class operator LessThan(const A, B: TBcd): Boolean;
    class operator GreaterThanOrEqual(const A, B: TBcd): Boolean;
    class operator LessThanOrEqual(const A, B: TBcd): Boolean;
  end;

C++

struct DECLSPEC_DRECORD TBcd
{
public:
    System::Byte Precision;
    System::Byte SignSpecialPlaces;
    System::StaticArray<System::Byte, 32> Fraction;
    static TBcd __fastcall _op_Implicit(const System::UnicodeString str);
    TBcd& __fastcall operator=(const System::UnicodeString str) { *this = TBcd::_op_Implicit(str); return *this; };
    static TBcd __fastcall _op_Implicit(const double d);
    TBcd& __fastcall operator=(const double d) { *this = TBcd::_op_Implicit(d); return *this; };
    static TBcd __fastcall _op_Implicit(const int I);
    TBcd& __fastcall operator=(const int I) { *this = TBcd::_op_Implicit(I); return *this; };
    static TBcd __fastcall _op_Addition(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator+(const TBcd& __rhs) { return TBcd::_op_Addition(*this, __rhs); };
    static TBcd __fastcall _op_Subtraction(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator-(const TBcd& __rhs) { return TBcd::_op_Subtraction(*this, __rhs); };
    static TBcd __fastcall _op_Multiply(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator*(const TBcd& __rhs) { return TBcd::_op_Multiply(*this, __rhs); };
    static TBcd __fastcall _op_Division(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator/(const TBcd& __rhs) { return TBcd::_op_Division(*this, __rhs); };
    static TBcd __fastcall _op_UnaryNegation(const TBcd &A);
    TBcd __fastcall operator-() { return TBcd::_op_UnaryNegation(*this); };
    static bool __fastcall _op_Equality(const TBcd &A, const TBcd &B);
    bool __fastcall operator==(const TBcd& __rhs) { return TBcd::_op_Equality(*this, __rhs); };
    static bool __fastcall _op_Inequality(const TBcd &A, const TBcd &B);
    bool __fastcall operator!=(const TBcd& __rhs) { return TBcd::_op_Inequality(*this, __rhs); };
    static bool __fastcall _op_GreaterThan(const TBcd &A, const TBcd &B);
    bool __fastcall operator>(const TBcd& __rhs) { return TBcd::_op_GreaterThan(*this, __rhs); };
    static bool __fastcall _op_LessThan(const TBcd &A, const TBcd &B);
    bool __fastcall operator<(const TBcd& __rhs) { return TBcd::_op_LessThan(*this, __rhs); };
    static bool __fastcall _op_GreaterThanOrEqual(const TBcd &A, const TBcd &B);
    bool __fastcall operator>=(const TBcd& __rhs) { return TBcd::_op_GreaterThanOrEqual(*this, __rhs); };
    static bool __fastcall _op_LessThanOrEqual(const TBcd &A, const TBcd &B);
    bool __fastcall operator<=(const TBcd& __rhs) { return TBcd::_op_LessThanOrEqual(*this, __rhs); };
};

Propriétés

Type Visibilité  Source Unité  Parent
record
struct
public
Data.FmtBcd.pas
Data.FMTBcd.hpp
Data.FmtBcd Data.FmtBcd

Description

TBcd stocke une valeur décimale codée en binaire.

TBcd représente une valeur décimale codée en binaire. Elle contient les champs suivants :



Champ Contenu

Precision

Nombre de chiffres dans la version décimale de la valeur.

SignSpecialPlaces

Le bit de signe (0 pour positif, toute autre valeur pour négatif)

Fraction

Un tableau de quartets BCD, 00 à 99 par octet, quartet de poids fort en premier. Seuls les premiers quartets Precision sont utilisés.



Vous pouvez créer un Variant qui représente une valeur TBcd à l'aide de la fonction VarFMTBcdCreate. De fait, la façon la plus facile de manipuler des valeurs TBcd consiste à créer des Variants pour celles-ci puis à utiliser les opérateurs intégrés fournis par le type Variant.

Voir aussi