Skip to content

Commit

Permalink
Merge pull request #832 from jpellegrini/srfi-144
Browse files Browse the repository at this point in the history
SRFI-144: accept zero arguments for flmax/flmin
  • Loading branch information
ashinn authored May 15, 2022
2 parents 42332bb + 32ce583 commit bf225ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/srfi/144/flonum.scm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
(define fl- -)
(define fl* *)
(define fl/ /)
(define flmax max)
(define flmin min)
(define (flmax . args) (if (null? args) -inf.0 (apply max args)))
(define (flmin . args) (if (null? args) +inf.0 (apply min args)))
(define (flabsdiff x y) (abs (- x y)))
(define flnumerator numerator)
(define fldenominator denominator)
Expand Down
9 changes: 9 additions & 0 deletions lib/srfi/144/test.sld
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,13 @@
(test -0.781212821 (flsecond-bessel 1 1.))
(test 0.842700793 (flerf 1.))
(test 0.157299207 (flerfc 1.))
(test #t (< 0.0
fl-least
fl-epsilon
1.0
(+ 1.0 fl-epsilon)
fl-greatest
+inf.0))
(test +inf.0 (flmin))
(test -inf.0 (flmax))
(test-end))))

0 comments on commit bf225ed

Please sign in to comment.