Difference between revisions of "BcdUnit"

From Lazarus wiki
Jump to navigationJump to search
 
Line 18: Line 18:
  
 
  pbcd will probably be a pointer to tbcd
 
  pbcd will probably be a pointer to tbcd
 +
 +
signspecialplaces and 63 = amount of decimal MINUS a still unknown number of default digits.
 +
 +
The bit with value 128 probably is the signbit.
  
 
== Const ==
 
== Const ==

Revision as of 11:33, 9 June 2005

Welcome

Welcome to information page about FMTBcd. Goal of this page is to contain information needed for implementing FPC version of the FMTBcd.



FMTBcd unit defines a number of binary-coded decimal (BCD) routines (find the source in ..\Delphi6\Source\Vcl):

Types

TBcd  = packed record
   Precision: Byte;
   SignSpecialPlaces: Byte;
   Fraction: packed array [0..31] of Byte;
 end;
pbcd will probably be a pointer to tbcd

signspecialplaces and 63 = amount of decimal MINUS a still unknown number of default digits.

The bit with value 128 probably is the signbit.

Const

 NullBcd

what is the NullBcd? is it a zero or invalid number?

Exceptions

 EBcdException, EBcdOverflowException

??

  EBcdException = Class(Exception);
  EBcdOverflowException = Class(Exception);

Utility

 BcdPrecision, BcdScale, IsBcdNegative

??

Arithmetic

 BcdAdd, BcdSubtract, NormalizeBcd, BcdMultiply (8 overloads)
   

Creation

 VarFMTBcdCreate (5 overloads), VarIsFMTBcd, VarFMTBcd
   

Conversions

 StrToBcd, TryStrToBcd, DoubleToBcd, DoubleToBcd, IntegerToBcd,
 VarToBcd, CurrToBCD, BcdToStr, BcdToDouble, BcdToInteger,
 BCDToCurr, BcdToStrF, FormatBcd, BcdCompare


Resources

only usable resource returned by google shows: http://homepages.borland.com/efg2lab/Library/Delphi/MathInfo/