Convert decimal number to rational: Difference between revisions
Content added Content deleted
(→{{header|Sidef}}: updated code + rational approximations) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 105: | Line 105: | ||
0.000000000 |
0.000000000 |
||
</pre> |
</pre> |
||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |
||
<lang applescript>on run |
<lang applescript>on run |
||
Line 564: | Line 565: | ||
3.14159265358979 → 104348 / 33215 |
3.14159265358979 → 104348 / 33215 |
||
2.71828182845905 → 49171 / 18089</pre> |
2.71828182845905 → 49171 / 18089</pre> |
||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
Line 696: | Line 695: | ||
3/4 |
3/4 |
||
</pre> |
</pre> |
||
⚫ | |||
⚫ | |||
⚫ | Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text ([http://wiki.formulae.org/Editing_F%C5%8Drmul%C3%A6_expressions more info]). Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation —i.e. XML, JSON— they are intended for transportation effects more than visualization and edition. |
||
⚫ | |||
=={{header|Forth}}== |
=={{header|Forth}}== |
||
Line 743: | Line 734: | ||
0.9054054e 100 RealToRational swap . . 67 74 |
0.9054054e 100 RealToRational swap . . 67 74 |
||
</lang> |
</lang> |
||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
Line 1,040: | Line 1,030: | ||
print n & ":", parserational(n) |
print n & ":", parserational(n) |
||
loop</lang> |
loop</lang> |
||
⚫ | |||
⚫ | |||
⚫ | Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text ([http://wiki.formulae.org/Editing_F%C5%8Drmul%C3%A6_expressions more info]). Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation —i.e. XML, JSON— they are intended for transportation effects more than visualization and edition. |
||
⚫ | |||
=={{header|Go}}== |
=={{header|Go}}== |
||
Line 1,797: | Line 1,795: | ||
approx below 1e+09: -1881244168 / 598818617 |
approx below 1e+09: -1881244168 / 598818617 |
||
approx below 1e+10: -9978066541 / 3176117225</pre> |
approx below 1e+10: -9978066541 / 3176117225</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 2,179: | Line 2,142: | ||
(exact->inexact 67/74) ; -> 0.9054054054054054 |
(exact->inexact 67/74) ; -> 0.9054054054054054 |
||
(inexact->exact 0.9054054054054054) ;-> 8155166892806033/9007199254740992</lang> |
(inexact->exact 0.9054054054054054) ;-> 8155166892806033/9007199254740992</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|REXX}}== |
=={{header|REXX}}== |