Least common multiple: Difference between revisions
→{{header|AppleScript}}
m (→{{header|TXR}}: Typo.) |
|||
Line 144:
=={{header|AppleScript}}==
<lang AppleScript>--
-- lcm :: Integral a => a -> a -> a
on lcm(x, y)
if x = 0 or y = 0 then
Line 154 ⟶ 156:
-- TEST ----------------------------------------------------------------------
on run
Line 162 ⟶ 164:
end run
-- GENERIC FUNCTIONS ---------------------------------------------------------
-- abs :: Num a => a -> a
Line 176 ⟶ 177:
-- gcd :: Integral a => a -> a -> a
on gcd(x, y)
script
on
if b = 0 then
a
else
end if
end
end script
end gcd</lang>
{{Out}}
<lang AppleScript>36</lang>
|