racket/collects/math/tests/flonum-tests.rkt
Neil Toronto 60dd8d065f Fixes for errors Pierpaolo Bernardi found by reviewing the docs; also,
renamed `partition-count' to `partitions' to be consistent with
`permutations', and gave better examples in `multinomial' docs

 * (flulp-error +inf.0 +nan.0) was returning +nan.0 instead of +inf.0

 * Type of `multinomial' didn't match its docs or `flmultinomial'

 * Reworded docs for `diagonal-array'

 * Reworked/reordered quite a few things in docs for `math/bigfloat'

 * Fixed first identity given in `gamma-inc' docs

 * Fixed descrption for `+max.0', etc.
2012-12-17 11:40:37 -07:00

21 lines
537 B
Racket

#lang racket
(require math/flonum
rackunit)
(for* ([x '(+inf.0 +nan.0 -inf.0)]
[y '(+inf.0 +nan.0 -inf.0)])
(cond [(eqv? x y)
(check-eqv? (flulp-error x y) 0.0 (format "(flulp-error ~v ~v)" x y))]
[else
(check-eqv? (flulp-error x y) +inf.0 (format "(flulp-error ~v ~v)" x y))]))
(check-equal? (flulp-error 55123.135123 55123.135123)
0.0)
(check-equal? (flulp-error 1.0 (flnext 1.0))
1.0)
(check-equal? (flulp-error +max.0 (flprev +max.0))
1.0)