But it fails for 1/28:
zn_order(10,28);
false
I don't think the dorks here know such stuff. And the good ones believe
it's waste of time but what they do (i.e. "fart") is not waste of time.
So I'll go ahead and ruin it for them all :)
(method of nines)
1/37252902384619140625
The decimal expansion will begin with 11 digits followed by a repeating porion of length 54,494,498,496.
This number would need 64 GiB of memory, but we could write it out to a
file using Maxima or bc or GMP.
1/28 = 0.03571428571428...
This is fantastic stuff!
On Thu, 7 Mar 2024 21:25:16 -0600, Physfitfreak wrote:
(method of nines)
Ah, nines. When I was in elementary school I got pretty good with the Trachtenberg system. I would check the answer by casting out the nines.
https://en.wikipedia.org/wiki/Trachtenberg_system https://en.wikipedia.org/wiki/Casting_out_nines
That really pissed off my teachers. "Show your work!"
(method of nines)
On 3/7/2024 12:11 PM, Nuxxie wrote:
Programming is about mathematics and not coding.
Problem:
Any rational number a/b (in lowest terms) can be expressed either
as a terminating decimal or a repeating decimal.
We consider here only repeating decimals.
Given, a and b, which are intergers with any number of digits,
find the repeating portion in the decimal expansion.
That is, the decimal expansion will be:
a1, a2, a3, ... an, [r1, r2, r3 ... rn]
where [... ri ...] is the repeating portion.
Example:
1/28 = 0.03 571428 571428...
The non-repeating, leading portion can be very long and so too can
the repeating portion.
I don't think the dorks here know such stuff. And the good ones believe
it's waste of time but what they do (i.e. "fart") is not waste of time.
So I'll go ahead and ruin it for them all :)
(method of nines)
On Thu, 07 Mar 2024 21:25:16 -0600, Physfitfreak wrote:
I don't think the dorks here know such stuff. And the good ones believe
it's waste of time but what they do (i.e. "fart") is not waste of time.
Project Euler, a well respected forum for programmers, doesn't think
that it's a waste of time:
https://projecteuler.net/problem=26
At one of my jobs, a printing clerk astonished me with calculating large multiplications in his mind, very fast. I kept asking him how he did it,
and he always only smiled at me Every time we were bored we would begin
a race getting the result of some multiplication in mind. Every single
time he won of course. It was fun.
I got very close to perfect scores in high school geometry. It's all downhill since.
The result:
The decimal expansion will begin with 11 digits followed
by a repeating porion of length 54,494,498,496.
This number would need 64 GiB of memory, but we could
write it out to a file using Maxima or bc or GMP.
I won't try but maybe someone else will.
This kind of stuff is what a computer is for. No fucking Netflix.
No fucking Gmail. Just this.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 52:19:07 |
Calls: | 6,912 |
Calls today: | 2 |
Files: | 12,379 |
Messages: | 5,430,161 |