You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
Python uses bigints by default, which means you can have arbitrarily large numbers. I noticed this when writing an abs macro. The following code produces two different outputs on my machine:
include "std.porth"
macro abs
if dup 0 < do0 over - swap drop
end
end
-18446744073709551615 abs
// becomes 1 on bare metal, 18446744073709551615 in Python
1 -
if0 = do
"We're running on bare metal!\n" puts
else
"We're in a simulation!\n" puts
end
Not sure if it's worth fixing in Python as when Porth becomes self-hosted this issue will go away.
At least it's amusing :)
The text was updated successfully, but these errors were encountered:
Python uses bigints by default, which means you can have arbitrarily large numbers. I noticed this when writing an
abs
macro. The following code produces two different outputs on my machine:Not sure if it's worth fixing in Python as when Porth becomes self-hosted this issue will go away.
At least it's amusing :)
The text was updated successfully, but these errors were encountered: