5 ms·
Right. A convenient property to have that is held by the Python version is (for nonzero n) x==n*floor(x/n)+x%n This property isn't held by the Javasc
by chalst 15y ago
Right.
A convenient property to have that is held by the Python version is (for nonzero n)
x==n*floor(x/n)+x%n
This property isn't held by the Javascript variant, where there is a somewhat more complex property
x==n*sign(x/n)*floor(abs(x/n))+x%n
- jacobolus 15y agoIn python, math.floor(x / n) can be written x // n, so: x == n * (x // n) + x % n