1. ? 2e100_000 -- a killer statement

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

new topic     » topic index » view message » categorize

2. Re: ? 2e100_000 -- a killer statement

_tom said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: ? 2e100_000 -- a killer statement

Stop measuring things in angstroms.

useless

new topic     » goto parent     » topic index » view message » categorize

4. Re: ? 2e100_000 -- a killer statement

_tom said...

...

? 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

new topic     » goto parent     » topic index » view message » categorize

5. Re: ? 2e100_000 -- a killer statement

ArthurCrump said...
_tom said...

...

? 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

new topic     » goto parent     » topic index » view message » categorize

6. Re: ? 2e100_000 -- a killer statement

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

new topic     » goto parent     » topic index » view message » categorize

7. Re: ? 2e100_000 -- a killer statement

Yes, this should probably be fixed.

new topic     » goto parent     » topic index » view message » categorize

8. Re: ? 2e100_000 -- a killer statement

ArthurCrump said...
_tom said...

...

? 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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu