Greatest common divisor: Difference between revisions

Content added Content deleted
(Add Refal)
(Add bruijn)
 
Line 2,300: Line 2,300:
<pre>{?} gcd$(49865.69811)
<pre>{?} gcd$(49865.69811)
{!} 9973</pre>
{!} 9973</pre>

=={{header|Bruijn}}==
As defined in <code>std/Math</code>.
<syntaxhighlight lang="bruijn">
:import std/Combinator .
:import std/Number .

gcd y [[[=?0 1 (2 0 (1 % 0))]]]

:test ((gcd (+2) (+4)) =? (+2)) ([[1]])
:test ((gcd (+10) (+5)) =? (+5)) ([[1]])
:test ((gcd (+3) (+8)) =? (+1)) ([[1]])
</syntaxhighlight>


=={{header|C}}==
=={{header|C}}==