smoge
June 26, 2023, 10:21am
#1
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!
opened 11:20AM - 26 Jun 23 UTC
bug
Hello guys,
I have come across an intriguing issue while using my `Rational` … Quark (https://github.com/smoge/Rational) 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 (recent development build), this produces the expected result:
```
--> 27 %/ 35
```
However, on MacOS (recent development build and stable official release), 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.
smoge
June 26, 2023, 12:02pm
#2
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?
smoge
June 26, 2023, 12:16pm
#3