Jump to content

Greatest common divisor: Difference between revisions

Added Bracmat
m (→‎{{header|Perl 6}}: works with any current implementation, actually, so drop works-with)
(Added Bracmat)
Line 258:
<lang befunge>#v&< @.$<
:<\g05%p05:_^#</lang>
 
=={{header|Bracmat}}==
Bracmat uses the Euclidean algorithm to simplify fractions. The <code>den</code> function extracts the denominator from a fraction.
<lang>(gcd=a b.!arg:(?a.?b)&!b*den$(!a*!b^-1)^-1);</lang>
Example:
<lang>
{?} gcd$(49865.69811)
{!} 9973</lang>
 
=={{header|C}}/{{header|C++}}==
483

edits

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