-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi,
In some code I'm writing I have to compare two creals. The code I'm using is the following:
(defun =r (a b precision)
(let ((a (approx-r a precision))
(b (approx-r b precision)))
(unless (= a b) (break))
(= a b)))
For some values, I end up in the debugger (with the break) but what is strange to me is that the backtrace (in sbcl BTW) shows me the following values for a and b:
Backtrace:
0: (GEODESIC/TEST::=R +1.87802555827473610813... +1.87802555827473610814... 17)
Locals:
A = +1.87802555827473610813...
A#1 = 246156
B = +1.87802555827473610814...
B#1 = 246157
PRECISION = 17
So the printed representation of creals a and b seems to be the same up to the 19th decimal but their (approx-r x 17) are different.
I don't really understand creals internal representation so I don't know how to proceed from here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels