Changeset 13652 in project


Ignore:
Timestamp:
03/10/09 09:47:58 (11 years ago)
Author:
Kon Lovett
Message:

Rmvd no-unbound-checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/mathh/trunk/mathh.scm

    r13570 r13652  
    2727  (number-type generic)
    2828  (no-procedure-checks)
    29   (no-bound-checks)
    3029  (bound-to-procedure
    3130    ##sys#check-inexact ) )
     
    6362(define-syntax define-unimplemented
    6463  (syntax-rules ()
    65     [(_ ?name)
    66      (define (?name . _) (%unimplemented-error ?name) ) ] ) )
     64    ((_ ?name)
     65     (define (?name . _) (%unimplemented-error ?name) ) ) ) )
    6766
    6867(define-syntax lambda-unimplemented
    6968  (syntax-rules ()
    70     [(_ ?name)
    71      (lambda _ (%unimplemented-error ?name) ) ] ) )
     69    ((_ ?name)
     70     (lambda _ (%unimplemented-error ?name) ) ) ) )
    7271
    7372;;;
     
    9998(define gamma
    10099  (cond-expand
    101     [windows  (lambda-unimplemented 'gamma) ]
    102     [linux    (foreign-lambda double "tgamma" double) ]
    103     [macosx   (foreign-lambda double "tgamma" double) ]
    104     [else     (foreign-lambda double "gamma" double) ] ) )
     100    (windows  (lambda-unimplemented 'gamma) )
     101    (linux    (foreign-lambda double "tgamma" double) )
     102    (macosx   (foreign-lambda double "tgamma" double) )
     103    (else     (foreign-lambda double "gamma" double) ) ) )
    105104
    106105(define tgamma gamma)
     
    110109(define lgamma
    111110  (cond-expand
    112     [windows  (lambda-unimplemented 'lgamma) ]
    113     [else     (foreign-lambda double "lgamma" double) ] ) )
     111    (windows  (lambda-unimplemented 'lgamma) )
     112    (else     (foreign-lambda double "lgamma" double) ) ) )
    114113
    115114;; Base-10 logarithm
     
    121120(define log2
    122121  (cond-expand
    123     [(or linux macosx bsd)
    124       (foreign-lambda double "log2" double) ]
    125     [else
     122    ((or linux macosx bsd)
     123      (foreign-lambda double "log2" double) )
     124    (else
    126125      (foreign-lambda* double ((double x)) "
    127126        #ifndef M_LN2
     
    139138        #endif
    140139        C_return( (log( 2.0 * M_PI * x) / 2.0) + (x * log( x / M_E )) );
    141         ") ] ) )
     140        ") ) ) )
    142141
    143142;; Natural logarithm of 1+x accurate for very small x
     
    145144(define log1p
    146145  (cond-expand
    147     [windows ; potentially inaccurate but ...
    148       (foreign-lambda* double ((double x)) "C_return( log( 1.0 + x ) );") ]
    149     [else
    150                   (foreign-lambda double "log1p" double) ] ) )
     146    (windows ; potentially inaccurate but ...
     147      (foreign-lambda* double ((double x)) "C_return( log( 1.0 + x ) );") )
     148    (else
     149                  (foreign-lambda double "log1p" double) ) ) )
    151150
    152151;; Compute x * 2**n
     
    158157(define scalbn
    159158  (cond-expand
    160     [windows ; not efficient but ...
    161       (foreign-lambda* double ((double x) (integer n)) "C_return( ldexp( x, n ) );")]
    162     [else
    163       (foreign-lambda double "scalbn" double integer)]) )
     159    (windows ; not efficient but ...
     160      (foreign-lambda* double ((double x) (integer n)) "C_return( ldexp( x, n ) );"))
     161    (else
     162      (foreign-lambda double "scalbn" double integer))) )
    164163
    165164;; Log function for base n
     
    168167        (when (fixnum? b) (set! b (exact->inexact b)))
    169168        (##sys#check-inexact b 'make-log/base)
    170         (cond [(fp= 2.0 b)    log2 ]
    171         [(fp= 10.0 b)   log10 ]
    172         [else
    173          (let ([lnb (log b)])
     169        (cond ((fp= 2.0 b)    log2 )
     170        ((fp= 10.0 b)   log10 )
     171        (else
     172         (let ((lnb (log b)))
    174173           (lambda (n)
    175              ((foreign-lambda* double ((double x) (double lnb)) "C_return( log( x ) / lnb );") n lnb)) ) ] ) )
     174             ((foreign-lambda* double ((double x) (double lnb)) "C_return( log( x ) / lnb );") n lnb)) ) ) ) )
    176175
    177176;; Flonum remainder
     
    205204(define fpclass
    206205  (cond-expand
    207     [(and windows (not cygwin))
     206    ((and windows (not cygwin))
    208207      (foreign-lambda* symbol ((double x)) "
    209208        char *name;
     
    244243        }
    245244        C_return( name );
    246                           ") ]
    247     [else
     245                          ") )
     246    (else
    248247      (foreign-lambda* symbol ((double x)) "
    249248        char *name;
     
    270269        }
    271270        C_return( name );
    272                           ") ] ) )
     271                          ") ) ) )
    273272
    274273;; Returns a symbol denoting the kind of floating-point number.
     
    276275(define fpclassify
    277276  (cond-expand
    278     [(and windows (not cygwin))
     277    ((and windows (not cygwin))
    279278      (foreign-lambda* symbol ((double x)) "
    280279        char *name;
     
    305304        }
    306305        C_return( name );
    307                           ") ]
    308     [else
     306                          ") )
     307    (else
    309308      (foreign-lambda* symbol ((double x)) "
    310309        char *name;
     
    330329        }
    331330        C_return( name );
    332                           ") ] ) )
     331                          ") ) ) )
    333332
    334333) ;module mathh
Note: See TracChangeset for help on using the changeset viewer.