Ask Your Question

Revision history [back]

I think there is no such function in Sage right now. I did see that the Octave rem() function works for non-integers as you are expecting. There is an interface for Octave in Sage, but note that it requires installing Octave separately:

The commands in this section only work if you have the optional “octave” interpreter installed and available in your PATH. It’s not necessary to install any special Sage packages.

I've also seen some indication that the JavaScript modulus operator works this way for non-integers too, but I can't find a good reference for it.

If you really want this feature to be added to sage, you should ask about it on the sage-devel list, and file a Trac ticket for it. Then you should write a patch to do what you want!