REBOL3 tracker
  0.9.12 beta
Ticket #0001753 User: anonymous

Project:



rss
TypeBug Statusbuilt Date9-Nov-2010 20:19
Versionalpha 110 CategoryMath Submitted bySunanda
PlatformAll Severityminor Prioritynormal

Summary TANGENT returns a decimal MOLD can't handle
Description Working close to TANGENT's outer limit:

mold tangent 89.99999999999986
== "399405529304859.^T" ;; That is not a really a decimal

***

Also, changing that last 6 to a 7:

R2 can return a result (though wolframalpha.com says it is not very accurate):
tangent 89.99999999999987
== 438274250673198.0

While R3 can't:

tangent 89.99999999999987
** Math error: math or number overflow
** Where: tangent
** Near: tangent 89.9999999999999
Example code
decimal? load mold tangent 89.99999999999986
 ;; given the unusual fractional part,
 ;; you might expect this to fail. But it
 ;; works, suggesting there is an edge case
 ;; for LOAD or TRANSCODE in there somewhere.

Assigned ton/a Fixed inalpha 111 Last Update22-Nov-2010 12:17


Comments
(0002814)
BrianH
9-Nov-2010 21:01

Is this only a problem on Windows? What about the other platforms?
(0002816)
Sunanda
9-Nov-2010 21:14

If it is only on some platforms, then it may somehow be related to #1122 (which is still a bug, at least on Windows)
(0002820)
abolka
10-Nov-2010 16:12

Same problem on Linux. Likely to be a problem in MOLD (as `tangent 89.99999999999986` returns a decimal!).
(0002821)
BrianH
10-Nov-2010 23:00

Note: The nonsense character is treated as whitespace by TRANSCODE - this is why LOAD works with corrupt output.
(0002909)
Ladislav
21-Nov-2010 16:09

in the core-tests suite
(0002910)
Carl
21-Nov-2010 21:14

The main bug is fixed (MOLD output), BUT, there may be other issues. Test in A111, and then post new bugs if needed.
(0002916)
Ladislav
22-Nov-2010 12:17

I am sure, that the other issue is related to the EQUAL? function and the test used:

>> equal? pi / 2 89.99999999999986 * pi / 180
== false

>> equal? pi / 2 89.99999999999987 * pi / 180
== true

So, this looks like the reason, why the overflow error is "fired". I do not see any problem in it, despite the fact, that the test in R2 worked differently.

Date User Field Action Change
22-Nov-2010 12:17 Ladislav Comment : 0002916 Added -
21-Nov-2010 21:14 carl Comment : 0002910 Added -
21-Nov-2010 21:13 carl Fixedin Modified => alpha 111
21-Nov-2010 21:13 carl Status Modified reviewed => built
21-Nov-2010 16:09 Ladislav Comment : 0002909 Added -
10-Nov-2010 23:00 BrianH Comment : 0002821 Added -
10-Nov-2010 22:58 BrianH Summary Modified TANGENT returns a non-decimal => TANGENT returns a decimal MOLD can't handle
10-Nov-2010 22:58 BrianH Description Modified -
10-Nov-2010 22:58 BrianH Code Modified -
10-Nov-2010 22:58 BrianH Status Modified submitted => reviewed
10-Nov-2010 22:58 BrianH Platform Modified Windows => All
10-Nov-2010 16:12 abolka Comment : 0002820 Added -
9-Nov-2010 21:14 sunanda Comment : 0002816 Added -
9-Nov-2010 21:01 BrianH Comment : 0002814 Added -
9-Nov-2010 20:19 sunanda Ticket Added -