monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

surprising precedence: base ** exponent :guard #208

Open dckc opened 5 years ago

dckc commented 5 years ago
▲> def Int32 :DeepFrozen := -(2 ** 31)..!2 ** 31
Result: <[-2147483648, 2147483648) Int region>
▲> 2**50 :Int32
Result: 1125899906842624

WAT?!

oh...

▲> m`base ** exponent :guard`.expand()
Result: m`base.pow(guard.coerce(exponent, throw))`