Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong String for reciprocals #161

Open
hypcos opened this issue Mar 15, 2024 · 1 comment
Open

Wrong String for reciprocals #161

hypcos opened this issue Mar 15, 2024 · 1 comment

Comments

@hypcos
Copy link

hypcos commented Mar 15, 2024

Input: Decimal.pow10(9996).pow10().recip()+''
Expect: 'e-e9996'
Output: 'ee-9996.000000000005'

This is VERY wrong.
ee-X means 10^(10^(-X)), which is not the reciprocal of 10^10^X, instead it is a number just a little bit bigger than 1.
e-eX (with big X) means 10^(-(10^X)), which is the reciprocal of 10^10^X.

@MathCookie17
Copy link
Collaborator

MathCookie17 commented Apr 8, 2024

This is not a bug - at least, I don’t think it is. Interpreted correctly, “ee-9996” would just be 1, as it’s so close to 1 that break_eternity wouldn’t be able to tell the difference. As such, this string is kinda useless. On the other hand, if we wanted the reciprocal of 10^^10, it would be very annoying to have to type “e-eeeeeeee10” with the negative sign specifically after the first one. Therefore, the way break_eternity handles negative exponents, a negative sign anywhere in the power tower is treated as if it’s on the first exponent, since negatives higher in the power tower aren’t useful. This lets you write “(e^10)-1” to mean the reciprocal of “(e^10)1”, which is more useful than what it would be if interpreted correctly. Yes, this means “ee-9996” is interpreted as “e-e9996”, but that’s intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants