Bug: asStringPrec - discrepancy between Linux (correct) and MacOS

Hello guys,

I have come across an intriguing issue while using my Rational Quark (GitHub - smoge/Rational: Rational Numbers extension to SuperCollider) type for fraction arithmetic.

For example, trying to multiply two Rational numbers, I observed that the output differs between Linux and MacOS.

Here is the snippet of the code:

Rational(3,7) * Rational(9,5) 
// or alternatively
(3 %/ 7) * (9 %/ 5)

On my Linux machine, this produces the expected result:

--> 27 %/ 35

However, on MacOS, the output has changed. It used to be the same as on Linux when I wrote it, but now it displays something different:

--> 3e+01 %/ 4e+01

I am wondering if anyone else has encountered this discrepancy and if there is any insight into why this might be happening.

Any assistance or thoughts would be greatly appreciated.

Thank you!

The discrepancy arises because the .asStringPrec(precision) method is being used to remove decimal numbers when posting x %/ y to the console, given that the denominator and numerator are represented as 64-bit floats. I’m intrigued as to why this change was implemented and why it seems to have no impact on Linux. Can someone provide some insights or explanations?

Maybe this change: reformat develop with clang-8 · supercollider/supercollider@f806ace · GitHub