fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.93k stars 284 forks source link

Inconsistency in operator for division of floats #2716

Closed ghost closed 9 months ago

ghost commented 9 months ago

To whom it may concern,

I have encountered an issue with the operand "/div (÷)" where the result (shown in picture) is rounded down automatically; however when I use the operand " (/) " it retrieves the exact float.

Is it possible to enable some similar functionality so that the /div operand also produces the same result as the standard divide operand?

working

not working

Pangoraw commented 9 months ago

This is the expected behavior: div (÷) refers to the integer division https://docs.julialang.org/en/v1/base/math/#Base.div You can use const ÷ = / if you want ÷ to behave like /