[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] [bug] FloatQ pi is not the extended precision nearest p
From: |
Nicolas Cellier |
Subject: |
[Help-smalltalk] [bug] FloatQ pi is not the extended precision nearest pi |
Date: |
Mon, 08 Jun 2009 15:28:50 -0700 |
Issue status update for
http://smalltalk.gnu.org/node/312
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/312
Project: GNU Smalltalk
Version: <none>
Component: Base classes
Category: bug reports
Priority: normal
Assigned to: Unassigned
Reported by: nice
Updated by: nice
Status: active
I get a surprising result:
FloatD pi sin abs < FloatQ pi sin abs.
true
Let pi be an exact representation.
I expect (pi - FloatD pi) abs > (pi - FloatQ pi) abs
And thus same relation-ship between sin...
I suspect FloatQ pi is not the nearest to pi:
(FloatQ class>>#pi) methodSourceString
'pi [
"Returns the value of pi. Hope is that it is precise enough"
^3.1415926535897930885169542232694q
]'
In contrast, the first decimals I compute are:
3.1415926535897932384626433832795028841971693993751058209749445923078164062862
3.1415926535897930885169542232694q
3.141592653589793d
3.1415928e
And this one is consistent with what I compute:
-1.0q arcCos
3.1415926535897932385
So I presume this is worth a bug report
- [Help-smalltalk] [bug] FloatQ pi is not the extended precision nearest pi,
Nicolas Cellier <=