[fpc-devel] MinCurrency

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Nov 18 14:32:36 CET 2015


LacaK wrote on Wed, 18 Nov 2015:

> There is also related bug report:  
> http://bugs.freepascal.org/view.php?id=28737
>
> And look at part of code in rtl/objpas/sysutils/sysstrh.inc:
>
> 41     {$if defined(FPC_HAS_TYPE_EXTENDED) or defined(FPC_HAS_TYPE_FLOAT128)}
> 42       MinCurrency: Currency = -922337203685477.5807;
> 43       MaxCurrency: Currency =  922337203685477.5807;
> 44     {$else}
> 45       MinCurrency: Currency = -922337203685477.0000;
> 46       MaxCurrency: Currency =  922337203685477.0000;
> 47     {$endif}
>
> Why is for case not defined(FPC_HAS_TYPE_EXTENDED), MinCurrency  
> defined as is ?

I think that on those targets, some currency handling is still (or  
was?) implemented via the double type (instead of fixed point using  
int64), and double does not have enough precision to represent  
922337203685477.5807.


Jonas



More information about the fpc-devel mailing list