From 9f9468f7c2cd7c8618f3575d384dd63c9c60598e Mon Sep 17 00:00:00 2001 From: John Clements Date: Thu, 3 May 2012 10:55:22 -0700 Subject: [PATCH] check-= uses magnitude to compare number differences --- collects/rackunit/private/check.rkt | 2 +- collects/rackunit/scribblings/check.scrbl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/rackunit/private/check.rkt b/collects/rackunit/private/check.rkt index fc3e723d09..3ad4b58f36 100644 --- a/collects/rackunit/private/check.rkt +++ b/collects/rackunit/private/check.rkt @@ -251,7 +251,7 @@ (equal? expr1 expr2)) (define-simple-check (check-= expr1 expr2 epsilon) - (<= (abs (- expr1 expr2)) epsilon)) + (<= (magnitude (- expr1 expr2)) epsilon)) (define-simple-check (check-true expr) (eq? expr #t)) diff --git a/collects/rackunit/scribblings/check.scrbl b/collects/rackunit/scribblings/check.scrbl index 83850a2b04..e7ebbbddc8 100644 --- a/collects/rackunit/scribblings/check.scrbl +++ b/collects/rackunit/scribblings/check.scrbl @@ -68,7 +68,7 @@ The following check fails: @defproc[(check-= (v1 any) (v2 any) (epsilon number?) (message string? "")) void?]{ -Checks that @racket[v1] and @racket[v2] are within +Checks that @racket[v1] and @racket[v2] are numbers within @racket[epsilon] of one another. The optional @racket[message] is included in the output if the check fails.