Die Suche ergab 5 Treffer

von BrunoK
Sa 25. Jun 2022, 14:12
Forum: Freepascal
Thema: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.
Antworten: 30
Zugriffe: 4455

Re: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.

Win fpc 3.2.2 x86_64 Was passiert mit dieser Zeile (abhängig vom generierten Code)? Brutto1:= DblToCurr4(Netto1 * 1.07); (Currency(Netto1) * Currency(1.07)) div 10000 -> ((Int64(3738) * int64(10700) = 39996600) div 10000) = 3999 Double(.3999) bekommt 0.39989999999999998 so DblToCurr4(0.3998999999999...
von BrunoK
Fr 24. Jun 2022, 21:23
Forum: Freepascal
Thema: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.
Antworten: 30
Zugriffe: 4455

Re: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.

and also win32 with FPC 3.2.2 i386
von BrunoK
Fr 24. Jun 2022, 21:21
Forum: Freepascal
Thema: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.
Antworten: 30
Zugriffe: 4455

Re: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.

win10, x86_64 fpc 3.2.2 WriteLn(SimpleFmtCurr(DblToCurr4(0.3738 * 1.07))); WriteLn(DblToCurr4(0.3738 * 1.07)); prints on my computer 0.4000 4.000000000000000000E-01 if counting in EURO (or CHF) you should store variables to Currency type using either RoudTo_Curr or RoundTo5_curr depending on the req...
von BrunoK
Fr 24. Jun 2022, 16:36
Forum: Freepascal
Thema: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.
Antworten: 30
Zugriffe: 4455

Re: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.

Attached file contains some helper routines for the currency data type that handles RoundTo_Curr, RoundTo5_Curr, Ceil_Curr and Trunc_Curr both on CPU32 and CPU64. Roundings are done 'away' from 0. function SimpleFmtCurr(aCurr) returns decimal raw string for Currency value. Except DblToCurr4, functio...
von BrunoK
So 19. Jun 2022, 13:50
Forum: Freepascal
Thema: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.
Antworten: 30
Zugriffe: 4455

Re: Funktionparameter-Typen werden bei 3.2.3. anders behandelt.

Currency multiply and divide on win64 - x86_64

This subject has been annoying me for a long time.

Do you allow me to comment in english in this discussion ?