Merge pull request #832 from jpellegrini/srfi-144

SRFI-144: accept zero arguments for flmax/flmin
This commit is contained in:
Alex Shinn 2022-05-15 22:21:56 +09:00 committed by GitHub
commit bf225edc8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -17,8 +17,8 @@
(define fl- -) (define fl- -)
(define fl* *) (define fl* *)
(define fl/ /) (define fl/ /)
(define flmax max) (define (flmax . args) (if (null? args) -inf.0 (apply max args)))
(define flmin min) (define (flmin . args) (if (null? args) +inf.0 (apply min args)))
(define (flabsdiff x y) (abs (- x y))) (define (flabsdiff x y) (abs (- x y)))
(define flnumerator numerator) (define flnumerator numerator)
(define fldenominator denominator) (define fldenominator denominator)

View file

@ -95,4 +95,13 @@
(test -0.781212821 (flsecond-bessel 1 1.)) (test -0.781212821 (flsecond-bessel 1 1.))
(test 0.842700793 (flerf 1.)) (test 0.842700793 (flerf 1.))
(test 0.157299207 (flerfc 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)))) (test-end))))