Recent

Author Topic: Floating point precision on 64bit Mac  (Read 1869 times)

tygraphics

  • New Member
  • *
  • Posts: 15
Floating point precision on 64bit Mac
« on: April 13, 2021, 05:21:49 pm »
I'm not a math person and I've only had two computer science classes back in 1986 when Pascal was the principle teaching language at the University of California. I've been exploring what FPC and am curious about its limitations.
How many places to the right of the decimal point does FPC handle accurately on a 64bit Mac?

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: Floating point precision on 64bit Mac
« Reply #1 on: April 13, 2021, 05:29:03 pm »
I don't know much about Mac but in general Lazarus/FPC should have at least 19 significant digits if you use Extended or Currency data types, read more:
https://www.freepascal.org/docs-html/ref/refsu5.html

If you're looking for high precision float, maybe this thread can be helpful:
https://forum.lazarus.freepascal.org/index.php/topic,43878.msg307740.html#msg307740

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Floating point precision on 64bit Mac
« Reply #2 on: April 13, 2021, 06:47:02 pm »
It depends which 64 bit Mac. If it's an Intel Mac, then it indeed has the 80 bits extended type. If it's a 64 bit PowerPC (unlikely) or ARM64/M1 Mac, then the maximum supported native floating point type is double (64 bits).

tygraphics

  • New Member
  • *
  • Posts: 15
Re: Floating point precision on 64bit Mac
« Reply #3 on: April 13, 2021, 10:22:49 pm »
Thank you!
Quad-Core Intel Core i5
It appears I can get significant results for 20 places.

 

TinyPortal © 2005-2018