Skip to main content

Timeline for x⌊x⌊x⌊x⌋⌋⌋ = 2020

Current License: CC BY-SA 4.0

7 events
when toggle format what by license comment
May 6, 2020 at 12:18 comment added Wood @mypronounismonicareinstate I didn't say it's faster, I said it's also relatively fast. My computer is very slow and it runs almost instantly. The product is a standard way of getting rid of nested for loops, and its use here is not necessary, it's just a matter of taste. Changing 2020 or 3 on the original code completely breaks the script. But what matters the most is that it's not clear that the original code gives an exact answer.
May 6, 2020 at 11:28 comment added the default. I can't see how it is any faster (especially as both use Python and are therefore very slow) nor how it is any easier to understand (hides the logic behind product((-1, 1), range(d_min, d_max + 1)) and other such stuff that takes precious seconds of thinking to decipher) nor how it is any more compact (twice as long) nor how it is significantly easier to adapt (changing 2020 or 3 isn't "adapting to a similar case" - it's the same problem).
May 6, 2020 at 10:17 comment added Wood @Yan It finds only exact solutions, because it uses fractions instead of floats. It works for other values besides 2020. It works for different number of nested floor functions. It automatically calculates the minimum and maximum denominators. It prints the result as a non-simplified fraction, the simplified one, and as a decimal representation. It's also relatively fast, compact, easy to understand, and easy to adapt to other similar cases.
May 6, 2020 at 8:52 comment added Yan @Wood - why do you think that your code is better?
May 6, 2020 at 7:43 comment added Wood A better Python code
May 4, 2020 at 20:02 vote accept Roman Odaisky
May 4, 2020 at 20:01 history answered trolley813 CC BY-SA 4.0