break_eternity.js icon indicating copy to clipboard operation
break_eternity.js copied to clipboard

different results when expexting the same result

Open 1231234md5 opened this issue 2 years ago • 5 comments

I tried 'ee4e-1' and 'ee0.4' in break_eternity.min.js(call it BEm.js), I got the following results: image what the fuck is that? (in the representation of BEm.js, it is about 5.918804334257232e-317 and 325.0022978095479, 300+ OoMs' difference)

1231234md5 avatar Feb 03 '23 09:02 1231234md5

break-eternity.js has the same problem

1231234md5 avatar Feb 03 '23 10:02 1231234md5

Just Why would someone use like ee0.4?

jakub791 avatar Feb 03 '23 22:02 jakub791

If we handled every possible notation like this one we'd surfer from performance issuses - parsing strings is already one of the slowest things in B_E

jakub791 avatar Feb 03 '23 22:02 jakub791

What if some notation uses it?

1231234md5 avatar Feb 04 '23 03:02 1231234md5

This probably comes from the way break_eternity handles negative exponents in strings. To ensure that, say “(e^100)-1” can be written to mean the reciprocal of “(e^100)1” (because that’s more useful behavior than what it would do if interpreted “correctly” - if interpreted correctly, writing the reciprocal of “(e^100)1” would require writing “e-eeeee….1” with 99 e’s after the negative sign), break_eternity takes negative signs anywhere above the base of the power tower and assumes they’re meant to apply to the first (i.e. the lowest non-base) exponent of the tower.

…although, interpreted in that way, “ee4e-1” would mean “e-e40”, which should have mag -40 and layer 2…

MathCookie17 avatar Apr 08 '24 12:04 MathCookie17