In the open source Mathematica implementation called Mathics, an issue was raised where Mathics computes Rationalize[-11.5, 1] as -12 rather than Mathematica which is reported to compute this as -11.
Looking at the docs for Rationalize, -11 seems equally valid.
Is this is purely an implementation choice, or is there more reasons why one answer is preferred over the other?
Rationalize[]uses the continued fraction expansion to find a rational approximation with least denominator. For negative numbers it proabably returns-Rationalize[-x]. I don't know how Mathics does it. – Michael E2 Aug 21 '21 at 15:29Mathics[]uses the continued fraction expansion as well on the bounds given. Here those values are -11.5 +/- 1 When the continued fraction of both of these differs in a digit that is when it stops. However the value it picks ismin(-13, -11) + 1which is -12. Of course, applying-Rationalize[-x]first in Mathics will give the answer reported . – rocky Aug 21 '21 at 16:59±xseems a nice feature. – Michael E2 Aug 21 '21 at 19:22Round[-11.5, 1]returns -12 in Mathematica. – Alexey Popkov Aug 22 '21 at 04:41Length[Names["System`*"]]gives 1130 builtins; probably far fewer than you get from MMA. https://mathics.org/docs/mathics-latest.pdf has what was available the end of July. My take though is that if you aren't someone who is willing to work on this in any capacity (which doesn't mean necessarily the Python code, it could be improving docs, writing compatibility libraries for older MMA or functions in the Wolfram Language, etc.), then I suggest waiting until others get around to improving things. It is not hard to find bugs. Harder is finding people to fix them. – rocky Aug 24 '21 at 14:49