Jump to content

Arithmetic/Rational: Difference between revisions

(Frink)
Line 1,114:
 
=={{header|Frink}}==
Rational numbers are built into Frink and the numerator and denominator can be arbitrarily-sized. They are automatically simplified into simplest form, and collapsed into integers if necessary. All functions in the language can work with rational numbers. Rational numbers are treated as exact. Rational numbers can exist in complex numbers or intervals.
<lang frink>
1/2 + 2/3
Line 1,124:
1/sextillion
// 1/1000000000000000000000 (exactly 1e-21)
 
8^(1/3)
// 2 (note the exact integer result.)
</lang>
 
494

edits

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