Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
What kind of datatype would you need to even test this? That is a lot of decimal points.
-
@Demolishun
the datatype is @wisecrack.
@kiki if anyone can explain this, it's our mathematitian/numberophile @wisecrack [whose alias conveniently matches the datatype] -
iiii90852y@Demolishun an analytical type. Python integers can hold an arbitrarily large number, for example.
-
C0D4669022yI'm sure @wisecrack can explain it better then most.
It's an interesting sequence though.
Just as you start to see what it's doing. It changes. -
Hazarth95212yIt's obvious when you look at it
000-999 is 1000 numbers, where 999 is the 1000th index
Now 998 is 999th number, but once your division reaches 999 (1000th number) that little 001 at the end of 998001 overflows, exactly at the 1000th number (999), so instead od 999 you get 1000, but what does that mean for the previous number, the 998? Simple, it now becomes 999!
And that's where the 998 went, so the sequence appears to be:
997...999...000...
But you can also consider it
997...998...(1 carry)000...
Do really It's the number 0.999 that's skipped, because of the 0.000001 at the end and at the 1000th index -
For those who don't want YouTube (although numberphile is always worth it), it has to do with the fact that the series a•x^(a-1) for all natural a, converges to 1/(1-x)^2 if magnitude of x is less than 1.
If you take x to be 0.1, 0.01, etc, you get 1 + 0.2 + 0.03 + 0.004 + ... = 1 / 0.9^2 = 100/9^2 = 100/81.
Divide by 100 to turn the 1.234... into 0.01234... and you get the effect. 8 is skipped because the tenth term causes a carry in the previous 9, causing a carry on the previous 8.
998001 just happens to be 999^2, thus producing three digit groups. -
For those who don't want YouTube (although numberphile is always worth it), it has to do with the fact that the series a•x^(a-1) for all natural a, converges to 1/(1-x)^2 if magnitude of x is less than 1.
If you take x to be 0.1, 0.01, etc, you get 1 + 0.2 + 0.03 + 0.004 + ... = 1 / 0.9^2 = 100/9^2 = 100/81.
Divide by 100 to turn the 1.234... into 0.01234... and you get the effect. 8 is skipped because the tenth term causes a carry in the previous 9, causing a carry on the previous 8.
998001 just happens to be 999^2, thus producing three digit groups.
wtf? can someone explain this?
random