Jump to content

Convert decimal number to rational: Difference between revisions

m
Line 1,184:
'''Solution'''
 
'''=== Case 1. Without repeating digits'''===
 
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]]
 
'''=== Case 2. With repeating digits''' ===
 
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]]
 
'''=== Programatically''' ===
 
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]]
2,120

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.