Anonymous user
Arithmetic/Integer: Difference between revisions
→{{header|Ol}}
Line 3,446:
(print "(modulo " a " " b ") => " (mod a b)) ; same as (modulo a b)
(print "(expt " a " " b ") => " (expt a b))
; you can use more than two arguments for +,-,*,/ functions▼
(print (+ 1 3 5 7 9))
(print (- 1 3 5 7 9))
</lang>
{{out}}
Line 3,459 ⟶ 3,466:
(modulo 8 12) => 8
(expt 8 12) => 68719476736
(gcd 8 12) => 4
(lcm 8 12) => 24
25
-23
945
1/945
</pre>
▲; you can use more than two arguments for +,-,*,/ functions
▲(print (+ 1 3 5 7 9)) ; ==> 25
▲(print (- 1 3 5 7 9)) ; ==> -23
▲(print (* 1 3 5 7 9)) ; ==> 945 - same as (1*3*5*7*9)
▲(print (/ 1 3 5 7 9)) ; ==> 1/945 - same as (((1/3)/5)/7)/9
=={{header|Onyx}}==
|