User talk:Chunes: Difference between revisions

Content added Content deleted
(→‎Quackery Bug Report: progress has been made)
Line 94: Line 94:


::: Thanks for the heads up. I'll hold off on tasks that prefer/require rational numbers for now. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 02:56, 27 January 2021 (UTC)
::: Thanks for the heads up. I'll hold off on tasks that prefer/require rational numbers for now. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 02:56, 27 January 2021 (UTC)

::::I figured it out to my satisfaction. Looks like the problem was with /mod, which rounds towards negative infinity. I'm pretty sure that what is required for mediant rounding is "round away from zero", and forcing positive numbers to temporarily be negative achieves that. Please don't ask me why - I'm not that much of a mathematician.<br><br>With that disclaimer, I'm going to mention the Factor results for [http://www.rosettacode.org/wiki/Convert_decimal_number_to_rational#Factor Convert decimal number to rational] - those unnecessarily big numbers are not dissimilar to some of the weird output I was getting. It's suggestive that a similar problem may be at play there. IF (and it's a big IF) it's doing mediant rounding, it really should be able to hit the answers on the nose...<lang>O> [ dup echo$
... say " is "
... $->v drop
... dup 100 > if
... [ say "approximately "
... proper 100 round
... improper ]
... vulgar$ echo$
... say "." cr ] is task ( $ --> )
...

Stack empty.

/O> $ "0.9054054 0.518518 0.75" nest$ witheach task
...
0.9054054 is approximately 67/74.
0.518518 is approximately 14/27.
0.75 is 3/4.
</lang>I know Factor is processing floating point and I'm processing strings, so it may just be that. Anyway up, it's back to more checking, double checking, triple checking ... for me.<br>--[[User:GordonCharlton|GordonCharlton]] ([[User talk:GordonCharlton|talk]]) 20:11, 28 January 2021 (UTC)