Registriert seit: 31. Mai 2009
1.198 Beiträge
Turbo Delphi für Win32
|
AW: Count digits after point
15. Feb 2014, 16:29
That is because there are some inaccuracy regarding non-integer numbers.
0.99999999999999999999.... is equal to 1!
(or your example: 2.048 could internally be 2.04799999999999999...)
Therefore your method needs to take that into account.
But sadly I have no idea since my knowledge about precision is not good. Someone else might be of help!
Edit: Another problem that came to mind is irrational numbers. I thought Id mention it but it shouldnt be too problematic since the data-type cuts off after a certain degree of precision..
das Erkennen beginnt, wenn der Erkennende vom zu Erkennenden Abstand nimmt
MfG
Geändert von Aphton (15. Feb 2014 um 16:36 Uhr)
|