1. ? 2e100_000 -- a killer statement
- Posted by _tom (admin) Jun 26, 2013
- 1431 views
The one line program
? 2e100_000 --BAD
- causes a huge jump in cpu usage and no result
- (testing on i5 netbook, Linux oEu 4.0.5)
The problem occurs with both eui and euc.
? 2e100_00 -- OK
_tom
2. Re: ? 2e100_000 -- a killer statement
- Posted by mattlewis (admin) Jun 26, 2013
- 1446 views
The one line program
? 2e100_000 --BAD
- causes a huge jump in cpu usage and no result
- (testing on i5 netbook, Linux oEu 4.0.5)
The problem occurs with both eui and euc.
? 2e100_00 -- OK
It's the brute force way we parse scientific notation. It's done by std/scinot.e. 2 * 10100,000 results in a lot of calls to carry() and a lot of sequence manipulation. It doesn't work well with such large exponents.
Matt
3. Re: ? 2e100_000 -- a killer statement
- Posted by useless_ Jun 26, 2013
- 1400 views
Stop measuring things in angstroms.
useless
4. Re: ? 2e100_000 -- a killer statement
- Posted by ArthurCrump Jun 26, 2013
- 1347 views
...
? 2e100_00 -- OK
_tom
Are you running a 64-bit Euphoria with a much bigger range of numbers? I am running 32-bit Euphoria 4.05 and ? 2e100_00 gives an answer in a reasonable time but I wouldn't say it's OK because it's the wrong answer. I get 1.412967193e+136 instead of 2e+10000; completely wrong.
Anything above about 1.8e308 gives a silly answer, sometimes with a negative exponent. For example, ?2e309 gives 6.180692095e-308
The numeric input routine should be able to detect that the number is out of range and report an error.
Arthur
5. Re: ? 2e100_000 -- a killer statement
- Posted by useless_ Jun 26, 2013
- 1311 views
...
? 2e100_00 -- OK
_tom
Are you running a 64-bit Euphoria with a much bigger range of numbers? I am running 32-bit Euphoria 4.05 and ? 2e100_00 gives an answer in a reasonable time but I wouldn't say it's OK because it's the wrong answer. I get 1.412967193e+136 instead of 2e+10000; completely wrong.
Anything above about 1.8e308 gives a silly answer, sometimes with a negative exponent. For example, ?2e309 gives 6.180692095e-308
The numeric input routine should be able to detect that the number is out of range and report an error.
Arthur
There's a few BCD math libs in the archives, at least one i think can handle unlimited number of digits.
useless
6. Re: ? 2e100_000 -- a killer statement
- Posted by _tom (admin) Jun 26, 2013
- 1302 views
The reason for the silly number was that I was trying to crash Euphoria. I wanted to compare the error message that Eu gives compared to an overflow error message from Python. It all comes down to comparing error messages so I can make the claim that Euphoria error messages are more meaningful (friendlier) than Python.
For something basic, like an undefined variable, Euphoria messages are easier to understand.
TOM
7. Re: ? 2e100_000 -- a killer statement
- Posted by jaygade Jun 26, 2013
- 1297 views
Yes, this should probably be fixed.
8. Re: ? 2e100_000 -- a killer statement
- Posted by ArthurCrump Jul 04, 2013
- 1195 views
...
? 2e100_00 -- OK
_tom
...
Anything above about 1.8e308 gives a silly answer, sometimes with a negative exponent. For example, ?2e309 gives 6.180692095e-308
The numeric input routine should be able to detect that the number is out of range and report an error.
Arthur
I have created a ticket for this Ticket:877
Arthur