Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-03

Floating point miscalculations on PowerPC

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tobias Giesen

Hello,

I'm using FPC 2.2.4 (ppcppc) to create a PowerPC app with Lazarus. It's running under Rosetta on an Intel Mac.

Simple floating point operations like this result in wrong code that creates wrong results:

-------------------
var it:Int64;
    dt:TDateTime
begin
  it:=ANumber;
  dt:Trunc(it/10.0+0.5) / 86400.0;
end;
-------------------

Does anybody remember a bug with TDateTime calculations and floating point constants that would only occur on the PowerPC platform? Has it been fixed?

Cheers,
Tobias

Reply by email

Jonas Maebe
to Tobias Giesen
Tobias Giesen wrote
I'm using FPC 2.2.4 (ppcppc) to create a PowerPC app with Lazarus. It's running under Rosetta on an Intel Mac.

Note that hardware exceptions cannot be handled by FPC when running under Rosetta.

Simple floating point operations like this result in wrong code

What wrong code?

that creates wrong results:

Which wrong results?

Show quoted text 8 lines
------------------- var it:Int64; dt:TDateTime begin it:=ANumber; dt:Trunc(it/10.0+0.5) / 86400.0; end; -------------------

Please always post
a) compilable code
b) the actual results
c) the expected results

Does anybody remember a bug with TDateTime calculations and floating point constants that would only occur on the PowerPC platform? Has it been fixed?

There are no known bugs with floating point calculations on PPC. However, there are several wrong assumptions often made by people who normally only use x86. You may be running into http://wiki.freepascal.org/User_Changes_2.2.0#Floating_point_calculations in combination with http://wiki.freepascal.org/User_Changes_2.2.0#Floating_point_constants

Jonas

Reply by email