I am new to SAGE and am having a problem with something very simple. I have the following code:
delay = float(3.5)
D = delay%1.0
D
But this returns the value -0.5
instead of the expected 0.5
. What am I doing wrong?
If I change delay to be delay = float(2.5)
, I get the right answer, so I don't know why it isn't consistent (I am sure I am using the modulo wrong somehow).