Convert decimal number to rational: Difference between revisions
Convert decimal number to rational (view source)
Revision as of 14:58, 2 February 2021
, 3 years agoAdded Quackery.
MaiconSoft (talk | contribs) (Added Delphi example) |
(Added Quackery.) |
||
Line 2,173:
[1] "157/50"
</pre>
=={{header|Quackery}}==
Using the Quackery big number rational arithmetic library <code>bigrat.qky</code>.
<lang Quackery>[ $ "bigrat.qky" loadfile ] now!
[ dup echo$
say " is "
$->v drop
dup 100 > if
[ say "approximately "
proper 100 round
improper ]
vulgar$ echo$
say "." cr ] is task ( $ --> )
$ "0.9054054 0.518518 0.75" nest$ witheach task</lang>
{{out}}
<pre>0.9054054 is approximately 67/74.
0.518518 is approximately 14/27.
0.75 is 3/4.</pre>
=={{header|Racket}}==
|