Changeset 10175


Ignore:
Timestamp:
10/21/05 12:13:09 (16 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/tests/math-tests.lisp

    r10171 r10175  
    22;;;
    33;;; Copyright (C) 2005 Peter Graves
    4 ;;; $Id: math-tests.lisp,v 1.4 2005-10-20 19:22:48 piso Exp $
     4;;; $Id: math-tests.lisp,v 1.5 2005-10-21 12:13:09 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    119119  nil)
    120120
     121(deftest single-float-epsilon.1
     122  single-float-epsilon
     123  #+lispworks 1.1102230246251568f-16
     124  #-lispworks 5.960465f-8)
     125
     126(deftest single-float-negative-epsilon.1
     127  single-float-negative-epsilon
     128  #+lispworks 5.551115123125784f-17
     129  #-lispworks 2.9802326f-8)
     130
    121131(deftest most-positive-single-float.1
    122132  most-positive-single-float
     
    375385(deftest log.3
    376386  (log 17 10)
    377   #+abcl                        1.2304488
    378   #+(or allegro clisp cmu sbcl) 1.230449
    379   #+lispworks                   #.(log 17d0 10d0))
     387  #+(and abcl java-1.4)               1.2304488
     388  #+(and abcl (or java-1.5 java-1.6)) 1.230449
     389  #+(or allegro clisp cmu sbcl)       1.230449
     390  #+lispworks                         #.(log 17d0 10d0))
    380391
    381392(deftest log.4
    382393  (log 17.0 10.0)
    383   #+(or abcl cmu sbcl) 1.2304488
    384   #+(or allegro clisp) 1.230449
    385   #+lispworks          #.(log 17d0 10d0))
     394  #+(and abcl java-1.4)               1.2304488
     395  #+(and abcl (or java-1.5 java 1.6)) 1.230449
     396  #+(or cmu sbcl)                     1.2304488
     397  #+(or allegro clisp)                1.230449
     398  #+lispworks                         #.(log 17d0 10d0))
    386399
    387400(deftest log.5
    388401  (log 17d0 10)
    389   #-(or allegro clisp lispworks) 1.2304489042913307d0
    390   #+(or allegro clisp lispworks) #.(log 17d0 10d0))
     402  #+(and abcl java-1.4)               1.2304489042913307d0
     403  #+(and abcl (or java-1.5 java-1.6)) #.(log 17d0 10d0)
     404  #+(or allegro clisp lispworks)      #.(log 17d0 10d0)
     405  #-(or abcl allegro clisp lispworks) 1.2304489042913307d0)
    391406
    392407(deftest log.6
    393408  (log 17 10d0)
    394   #-(or allegro clisp lispworks) 1.2304489149763256d0
    395   #+(or allegro clisp lispworks) #.(log 17d0 10d0))
     409  #+(and abcl java-1.4)               1.2304489149763256d0
     410  #+(and abcl (or java-1.5 java-1.6)) #.(log 17d0 10d0)
     411  #+(or allegro clisp lispworks)      #.(log 17d0 10d0)
     412  #-(or abcl allegro clisp lispworks) 1.2304489149763256d0)
    396413
    397414(deftest log.7
     
    399416  1.2304489213782739d0)
    400417
     418(deftest pi.1
     419  pi
     420  #+clisp 3.1415926535897932385l0
     421  #-clisp 3.141592653589793d0)
     422
     423(deftest tan.1
     424  (tan 1)
     425  #+lispworks 1.5574077246549023
     426  #-lispworks 1.5574077)
     427
     428(deftest tan.2
     429  (tan (- (/ pi 2) 0.0001))
     430  #+(or abcl allegro cmu sbcl) 10000.0002192818d0
     431  #+clisp                      10000.000219287924741l0
     432  #+lispworks                   9999.999966661644)
     433
     434(deftest tan.3
     435  (tan (/ pi 2))
     436  #+abcl                             1.633123935319537d16
     437  #+(or allegro cmu lispworks sbcl)  1.6331778728383844d16
     438  #+clisp                           -3.9867976290042641156l19)
     439
     440(deftest tan.4
     441  (tan (+ (/ pi 2) 0.0001))
     442  #+(or abcl allegro cmu sbcl) -10000.000219294045d0
     443  #+clisp                      -10000.000219287919724l0
     444  #+lispworks                   -9999.999966673891d0)
     445
    401446(deftest truncate.1
    402447  (truncate least-positive-single-float)
     
    415460  t)
    416461
     462(deftest read-from-string.1
     463  #+(or cmu sbcl)
     464  (unwind-protect
     465      (signals-error (read-from-string "1.0f-1000") 'reader-error)
     466    (progn
     467      (ignore-errors (set-floating-point-modes :traps '(:underflow)))
     468      (restore-default-floating-point-modes)))
     469  #-(or cmu sbcl)
     470  (signals-error (read-from-string "1.0f-1000") 'reader-error)
     471  t)
     472
    417473(do-tests)
Note: See TracChangeset for help on using the changeset viewer.