-
Notifications
You must be signed in to change notification settings - Fork 128
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
The irrational number e is not always understood #2455
Comments
Excellent catch! I have reduced this to the following test case: :- use_module(library(debug)). p([X], Y) :- $Y is X. Yielding: ?- p("e", R). call:(A is e). exception:error(type_error(evaluable,e),(is)/2):(A is e). error(type_error(evaluable,e),(is)/2), unexpected. On the other hand, querying the traced goal in isolation works as expected: ?- A is e. A = 2.718281828459045. % expected |
I think this is even shorter: ?- [X] = "e", _ is X. Surprisingly it works for pi: ?- [X] = [pi], _ is X. |
It looks suspiciously like yet another issue due to the currently only partially finished partial string representation (#24). |
Makes sense, also this
works fine whereas this
is not working fine. |
The case is now moved to https://github.com/eyereasoner/euler/blob/main/cases/complex.pl |
The problem got worse with ?- _ is e. error(type_error(evaluable,e),(is)/2), unexpected. true. % expected; works in master |
I found a workaround so that you can at least continue for the time being if you want to use it: ?- X is 0 + e. X = 2.718281828459045. |
Thanks @triska and this now works fine in https://github.com/eyereasoner/euler/blob/574fcec024bfd86e0c035de1210a891ed390dc66/cases/complex.pl |
The following case https://github.com/eyereasoner/eye/blob/1ea6435149beb4d4a483ddb761eae85def65db16/see/temp/complex.pl gives
whereas we expect
The irrational number pi seems to be understood correctly.
This is also fine
The text was updated successfully, but these errors were encountered: