08-12-2022, 03:25 PM
Honestly, I don't see why this is a head scratcher at all. @Pete is converting the decimal to a fraction here..
.33... = 1/3
.66... = 2/3
.99... = 3/3
All good and well, and then in the last case his faction just simplifies to 1.
I'd imagine the code is written to simplify fractions, at least? Otherwise, why don't we see 0.33 = 2/6 or 100/300, or some such? I suppose it might could give an answer of 1/1, but I imagine there's something in Pete's code that just turns it into an integer, when the divisor is 1, just like it'd probably toss an error with a divisor of 2.
Not too much of a head scratcher to think that 3/3 = 1. At least, not to my way of thinking, it's not.
.33... = 1/3
.66... = 2/3
.99... = 3/3
All good and well, and then in the last case his faction just simplifies to 1.
I'd imagine the code is written to simplify fractions, at least? Otherwise, why don't we see 0.33 = 2/6 or 100/300, or some such? I suppose it might could give an answer of 1/1, but I imagine there's something in Pete's code that just turns it into an integer, when the divisor is 1, just like it'd probably toss an error with a divisor of 2.
Not too much of a head scratcher to think that 3/3 = 1. At least, not to my way of thinking, it's not.