0

In Delphi when I try to do this:

tmp := Frac(Frac(135.45)*100); 

I see that it returns 1, when I expected 0. Why? tmp in this case is a Real variable.

Also, I used the below code to receive a visual confirmation:

Dialogs.ShowMessage(Format('Frac1=%f  Frac2=%f', [Frac(Frac(135.45)*100), Frac(45)]));

What is wrong? Is it a Delphi bug?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770

0 Answers0