Convert decimal number to rational: Difference between revisions
Convert decimal number to rational (view source)
Revision as of 20:14, 17 September 2023
, 8 months ago→{{header|Fōrmulæ}}
Line 1,184:
'''Solution'''
The Fōrmulæ '''Rationalize''' expression converts from decimal numberts to rational in lower terms.
Line 1,191:
[[File:Fōrmulæ - Convert decimal number to rational 02.png]]
[[File:Fōrmulæ - Convert decimal number to rational 03.png]]
Line 1,196 ⟶ 1,197:
[[File:Fōrmulæ - Convert decimal number to rational 04.png]]
Fōrmulæ '''Rationalize''' expression can convert from decimal numbers with infinite number of repeating digits. The second arguments specifies the number of repeating digits.
Line 1,203 ⟶ 1,204:
[[File:Fōrmulæ - Convert decimal number to rational 06.png]]
In the following example, a conversion of the resulting rational back to decimal is provided in order to prove that it was correct:
Line 1,213 ⟶ 1,215:
[[File:Fōrmulæ - Convert decimal number to rational 10.png]]
[https://en.wikipedia.org/wiki/0.999... 0.999... is actually 1]:
Line 1,220 ⟶ 1,223:
[[File:Fōrmulæ - Convert decimal number to rational 12.png]]
Even when rationalization expressions are intrinsic in Fōrmulæ, we can write explicit functions:
Line 1,229 ⟶ 1,232:
[[File:Fōrmulæ - Convert decimal number to rational 15.png]]
[[File:Fōrmulæ - Convert decimal number to rational 16.png]]
|