Add abs.
* module/mes/scm.mes (abs): New function.
This commit is contained in:
parent
23754e6f75
commit
8b172e3438
|
@ -185,6 +185,9 @@
|
|||
(define (1- x)
|
||||
(- x 1))
|
||||
|
||||
(define (abs x)
|
||||
(if (>= x 0) x (- x)))
|
||||
|
||||
(define (expt x y)
|
||||
(let loop ((s 1) (count y))
|
||||
(if (= 0 count) s
|
||||
|
|
Loading…
Reference in a new issue