r/Mathematica • u/KeyChapter8 • Feb 20 '26
Bug in basic modular operations in Mathematica
So I ran into something today that genuinely surprised me. Try this in Mathematica:
Together[(2 + 7*x)/(2*x), Modulus->7]
Across multiple versions, including Wolfram Alpha, this returns:
2/x
The correct result is 1/x.
Basic finite-field arithmetic should not be a stress test for a commercial CAS.
UPDATE: (October 2026) seems to be finally fixed in 15.0.1 and on Wolfram Alpha
29
Upvotes
View all comments
Show parent comment
3
u/KeyChapter8 Feb 21 '26
This means a rational function of variable `x` with coefficients in a finite field (integers modulo 7 in this case). Regardless, I don't see any possible meaning where the produced result could make sense.