diff --git a/collects/tests/racket/benchmarks/shootout/lists.rkt b/collects/tests/racket/benchmarks/shootout/lists.rkt index 9667daadc4..f2a735fe85 100644 --- a/collects/tests/racket/benchmarks/shootout/lists.rkt +++ b/collects/tests/racket/benchmarks/shootout/lists.rkt @@ -33,7 +33,7 @@ (else (mlength L1))))) (define (main args) - (let ((result #f)) + (let ((result 0)) (let loop ((counter (if (= (vector-length args) 0) 1 (string->number (vector-ref args 0))))) diff --git a/collects/tests/racket/benchmarks/shootout/moments.rkt b/collects/tests/racket/benchmarks/shootout/moments.rkt index 0d4355413d..7044cc342e 100644 --- a/collects/tests/racket/benchmarks/shootout/moments.rkt +++ b/collects/tests/racket/benchmarks/shootout/moments.rkt @@ -3,7 +3,8 @@ #lang racket/base (require (only-in mzlib/list sort) - (only-in mzlib/string real->decimal-string)) + (only-in mzlib/string real->decimal-string) + racket/flonum) (define (to-str n) (real->decimal-string n 6)) @@ -29,15 +30,15 @@ (begin (set! deviation (- (car nums) mean)) (set! average_deviation (+ average_deviation (abs deviation))) - (set! variance (+ variance (expt deviation 2.0))) - (set! skew (+ skew (expt deviation 3.0))) + (set! variance (+ variance (expt deviation 2))) + (set! skew (+ skew (expt deviation 3))) (set! kurtosis (+ kurtosis (expt deviation 4))) (loop (cdr nums))) #t)) (set! average_deviation (/ average_deviation (exact->inexact n))) (set! variance (/ variance (- n 1))) - (set! standard_deviation (sqrt variance)) + (set! standard_deviation (flsqrt variance)) (cond ((> variance 0.0) (set! skew (/ skew (* n variance standard_deviation))) diff --git a/collects/tests/racket/benchmarks/shootout/nbody.rkt b/collects/tests/racket/benchmarks/shootout/nbody.rkt index 7e94db096c..619e43f8e4 100644 --- a/collects/tests/racket/benchmarks/shootout/nbody.rkt +++ b/collects/tests/racket/benchmarks/shootout/nbody.rkt @@ -26,7 +26,7 @@ Correct output N = 1000 is (define +pi+ 3.141592653589793) (define +days-per-year+ 365.24) -(define +solar-mass+ (* 4 +pi+ +pi+)) +(define +solar-mass+ (* 4.0 +pi+ +pi+)) (define +dt+ 0.01)