Changeset 34503 in project


Ignore:
Timestamp:
09/04/17 00:28:07 (3 months ago)
Author:
kon
Message:

add types

Location:
release/4/mathh/trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • release/4/mathh/trunk/fp-utils.scm

    r34132 r34503  
    11;;;; fp-utils.scm
    22;;;; Kon Lovett, May '17
     3;;;; Kon Lovett, Sep '17
    34
    45;;;; Issues
     
    1112  fprandom
    1213  ;
    13   fpzero? fppositive? fpcardinal? fpnegative? fpeven? fpodd?
     14  fpzero? fppositive? fpcardinal? fpnegative? fpnon-positive?
     15  ;
     16  fpeven? fpodd?
    1417  ;
    1518  fpclosed-right? fpclosed? fpclosed-left? fpclosedr? fpclosedl?
     
    5356  (foreign-lambda double "remainder" double double))
    5457
     58(: *fpeven? (float --> boolean))
    5559(define (*fpeven? n)
    5660  (fp= 0.0 (##sys#flonum-fraction (fp/ n 2.0))) )
     
    6064;;
    6165
     66(: fprandom (#!optional (or float fixnum) --> float))
    6267(define (fprandom #!optional (x most-positive-fixnum))
    63   (fp/ 1.0 (exact->inexact (random x))) )
    64 
    65 ;;
    66 
     68  ;
     69  (define log10
     70    (let ((ln10 (log 10)))
     71      (lambda (n)
     72        (fp/ (log n) ln10) ) ) )
     73  ;
     74  (let ((x
     75          (cond
     76            ((flonum? x)
     77              (inexact->exact (expt 10 (abs (round (log10 x))))) )
     78            (else ;(fixnum? x)
     79              x ) ) ) )
     80    (fp/ 1.0 (exact->inexact (random x))) ) )
     81
     82;;
     83
     84(: fpzero? (float --> boolean))
    6785(define (fpzero? n)
    6886  (fp= 0.0 n) )
    6987
     88(: fppositive? (float --> boolean))
    7089(define (fppositive? n)
    7190  (fp< 0.0 n) )
    7291
     92(: fpcardinal? (float --> boolean))
    7393(define (fpcardinal? n)
    7494  (fp<= 0.0 n) )
    7595
     96(: fpnegative? (float --> boolean))
    7697(define (fpnegative? n)
    7798  (fp> 0.0 n) )
    7899
     100(: fpnon-positive? (float --> boolean))
     101(define (fpnon-positive? n)
     102  (fp>= 0.0 n) )
     103
     104;;
     105
     106(: fpeven? (float --> boolean))
    79107(define (fpeven? n)
    80108  (and
     
    82110    (*fpeven? n)) )
    83111
     112(: fpodd? (float --> boolean))
    84113(define (fpodd? n)
    85114  (and
     
    89118;;
    90119
     120(: fpclosed-right? (float float float --> boolean))
    91121(define (fpclosed-right? l x h)
    92122  (and (fp< l x) (fp<= x h)) )
    93123
     124(: fpclosed? (float float float --> boolean))
    94125(define (fpclosed? l x h)
    95126  (and (fp<= l x) (fp<= x h)) )
    96127
     128(: fpclosed-left? (float float float --> boolean))
    97129(define (fpclosed-left? l x h)
    98130  (and (fp<= l x) (fp< x h)) )
    99131
     132(: fpclosedr? (float float float --> boolean))
    100133(define fpclosedr? fpclosed-right?)
     134
     135(: fpclosedl? (float float float --> boolean))
    101136(define fpclosedl? fpclosed-left?)
    102137
    103138;;
    104139
     140(: fpadd1 (float --> float))
    105141(define (fpadd1 n)
    106142  (fp+ n 1.0) )
    107143
     144(: fpsub1 (float --> float))
    108145(define (fpsub1 n)
    109146  (fp- n 1.0) )
     
    111148;;
    112149
     150(: fpmodulo (float float --> float))
    113151(define (fpmodulo x y)
    114152  (##sys#check-inexact x 'fpmodulo)
     
    116154  (fptruncate (C_fmod x y)) )
    117155
     156(: fpquotient (float float --> float))
    118157(define (fpquotient x y)
    119158  (fptruncate (fp/ x y)) )
    120159
     160(: fpremainder (float float --> float))
    121161(define (fpremainder x y)
    122162  (##sys#check-inexact x 'fpremainder)
     
    126166;;
    127167
     168(: fpfraction (float --> float))
    128169(define (fpfraction n)
    129170        (##sys#flonum-fraction n) )
     
    133174;;
    134175
     176(: fp~= (float float #!optional float --> boolean))
    135177(define (fp~= x y #!optional (eps flonum-epsilon))
    136178  (let ((diff (fp- x y)))
     
    139181      (fp<= (fpabs diff) eps) ) ) )
    140182
     183(: fp~<= (float float #!optional float --> boolean))
    141184(define (fp~<= x y #!optional (eps flonum-epsilon))
    142185  (or
     
    144187    (fp~= x y eps) ) )
    145188
     189(: fp~>= (float float #!optional float --> boolean))
    146190(define (fp~>= x y #!optional (eps flonum-epsilon))
    147191  (or
     
    153197;;
    154198
     199(: fpsqr (float --> float))
    155200(define (fpsqr n)
    156201  (fp* n n) )
    157202
     203(: fpcub (float --> float))
    158204(define (fpcub n)
    159205  (fp* n (fp* n n)) )
     
    174220;;
    175221
     222(: fptruncate/precision (float #!optional float --> float))
    176223(define fptruncate/precision (make-unary/precision fptruncate))
     224
     225(: fpround/precision (float #!optional float --> float))
    177226(define fpround/precision (make-unary/precision fpround))
     227
     228(: fpceiling/precision (float #!optional float --> float))
    178229(define fpceiling/precision (make-unary/precision fpceiling))
     230
     231(: fpfloor/precision (float #!optional float --> float))
    179232(define fpfloor/precision (make-unary/precision fpfloor))
    180233
     
    183236(define-constant DEGREE 0.0174532925199432957692369076848861271344) ;pi/180
    184237
     238(: fpdegree->radian (float --> float))
    185239(define (fpdegree->radian deg)
    186240  (fp* deg DEGREE) )
    187241
     242(: fpradian->degree (float --> float))
    188243(define (fpradian->degree rad)
    189244  (fp/ rad DEGREE) )
     
    191246;;
    192247
     248(: fpdistance (float float float float --> float))
    193249(define (fpdistance x1 y1 x2 y2)
    194250  (fpsqrt (fpdistance* x1 y1 x2 y2)) )
    195251
     252(: fpdistance* (float float float float --> float))
    196253(define (fpdistance* x1 y1 x2 y2)
    197254  (fp+ (fpsqr (fp- x1 x2)) (fpsqr (fp- y1 y2))) )
     
    199256;;
    200257
     258(: fpmax-and-min (float #!rest float --> float float))
    201259(define (fpmax-and-min fp . fps)
    202260  (let loop ((fps fps) (mx fp) (mn fp))
     
    208266;;
    209267
     268(: fpprecision-factor ((or float fixnum) #!optional float --> float))
    210269(define (fpprecision-factor p #!optional (base 10.0))
    211270  (fpexpt base (exact->inexact p)) )
  • release/4/mathh/trunk/fx-utils.scm

    r34132 r34503  
    7272  fxrandom
    7373  ;
    74   fxzero? fxpositive? fxcardinal? fxnegative?
     74  fxzero? fxpositive? fxcardinal? fxnegative? fxnon-positive?
    7575  ;
    7676  fxclosed-right? fxclosed? fxclosed-left? fxclosedr? fxclosedl?
     
    101101  (foreign-lambda unsigned-long C_uword_log2 unsigned-long))
    102102
     103(: *fxrandom (fixnum --> fixnum))
    103104(define (*fxrandom x)
    104105  (##core#inline "C_random_fixnum" x) )
    105106
     107(: *fxadd1 (fixnum --> fixnum))
    106108(define (*fxadd1 fx)
    107109  (##core#inline "C_fixnum_increase" fx) )
    108110
     111(: *fxsub1 (fixnum --> fixnum))
    109112(define (*fxsub1 fx)
    110113  (##core#inline "C_fixnum_decrease" fx) )
     
    114117;;
    115118
     119(: fxrandom (#!optional fixnum --> fixnum))
    116120(define (fxrandom #!optional (x most-positive-fixnum))
    117121  (*fxrandom x) )
     
    119123;;
    120124
     125(: fxzero? (fixnum --> boolean))
    121126(define (fxzero? n)
    122127  (fx= 0 n) )
    123128
     129(: fxpositive? (fixnum --> boolean))
    124130(define (fxpositive? n)
    125131  (fx< 0 n) )
    126132
     133(: fxcardinal? (fixnum --> boolean))
    127134(define (fxcardinal? n)
    128135  (fx<= 0 n) )
    129136
     137(: fxnegative? (fixnum --> boolean))
    130138(define (fxnegative? n)
    131139  (fx> 0 n) )
    132140
    133 ;;
    134 
     141(: fxnon-positive? (fixnum --> boolean))
     142(define (fxnon-positive? n)
     143  (fx>= 0 n) )
     144
     145;;
     146
     147(: fxclosed-right? (fixnum fixnum fixnum --> boolean))
    135148(define (fxclosed-right? l x h)
    136149  (and (fx< l x) (fx<= x h)) )
    137150
     151(: fxclosed? (fixnum fixnum fixnum --> boolean))
    138152(define (fxclosed? l x h)
    139153  (and (fx<= l x) (fx<= x h)) )
    140154
     155(: fxclosed-left? (fixnum fixnum fixnum --> boolean))
    141156(define (fxclosed-left? l x h)
    142157  (and (fx<= l x) (fx< x h)) )
    143158
     159(: fxclosedr? (fixnum fixnum fixnum --> boolean))
    144160(define fxclosedr? fxclosed-right?)
     161
     162(: fxclosedl? (fixnum fixnum fixnum --> boolean))
    145163(define fxclosedl? fxclosed-left?)
    146164
     
    149167;;
    150168
     169(: fxabs (fixnum --> fixnum))
    151170(define (fxabs n)
    152171  (if (fxnegative? n) (fxneg n) n) )
     
    154173;;
    155174
     175(: fxadd1 (fixnum --> fixnum))
    156176(define (fxadd1 n)
    157177  (*fxadd1 n) )
    158178
     179(: fxsub1 (fixnum --> fixnum))
    159180(define (fxsub1 n)
    160181  (*fxsub1 n) )
     
    162183;;
    163184
     185(: fxpow2log2 (fixnum --> fixnum))
    164186(define (fxpow2log2 n)
    165187  (fxshl 2 (C_uword_log2 n)) )
    166188
    167 #;
     189#|
     190(: *pow2log2 (fixnum --> fixnum))
    168191(define *pow2log2
    169192  (foreign-lambda* unsigned-long ((long n))
    170193   "return( 2 << C_uword_log2( (C_uword) n ) );"))
    171 
     194|#
     195
     196(: fxsqr (fixnum --> fixnum))
    172197(define (fxsqr n)
    173198  (fx* n n) )
    174199
     200(: fxcub (fixnum --> fixnum))
    175201(define (fxcub n)
    176202  (fx* n (fx* n n)) )
     
    178204;;
    179205
     206(: fxdistance (fixnum fixnum fixnum fixnum --> fixnum))
    180207(define (fxdistance x1 y1 x2 y2)
    181208  (fx/ (fxdistance* x1 y1 x2 y2) 2) )
    182209
     210(: fxdistance* (fixnum fixnum fixnum fixnum --> fixnum))
    183211(define (fxdistance* x1 y1 x2 y2)
    184212  (fx+ (fxsqr (fx- x1 x2)) (fxsqr (fx- y1 y2))) )
     
    186214;;
    187215
     216(: fxmax-and-min (fixnum #!rest fixnum --> fixnum fixnum))
    188217(define (fxmax-and-min fx . fxs)
    189218  (let loop ((fxs fxs) (mx fx) (mn fx))
  • release/4/mathh/trunk/mathh.meta

    r34132 r34503  
    1313  "mathh-constants.scm" "mathh-consts.scm"
    1414  "fp-utils.scm" "fx-utils.scm"
    15   "tests/run.scm") )
     15  "tests/run.scm" "tests/mathh-test.scm") )
  • release/4/mathh/trunk/mathh.scm

    r34098 r34503  
    11;;;; mathh.scm
    22;;;; Kon Lovett & John Cowen, '07 - '08
    3 ;;;; Kon Lovett, Mar '09 - '10, '15
     3;;;; Kon Lovett, Mar '09 - '10, '15, Sep '17
    44;;;; Peter Bex, Aug '15
    55
     
    308308(define signbit
    309309  (cond-expand
    310     (windows  (foreign-lambda* bool ((double n)) "C_return( _copysign( 1.0, n ) < 0 );"))
    311     (else     (foreign-lambda bool "signbit" double)) ) )
     310    (windows
     311      (foreign-lambda* bool ((double n)) "C_return( _copysign( 1.0, n ) < 0 );"))
     312    (else
     313      (lambda (num)
     314        (or
     315          (fp= -0.0 num)
     316          ((foreign-lambda bool "signbit" double) num) ) ) ) ) )
    312317
    313318;; Cube Root
     
    362367        C_return( name );") )
    363368    (else
    364       (foreign-lambda* symbol ((double x)) "
    365         char *name;
    366         switch (fpclassify( x )) {
    367         case FP_INFINITE:
    368           name = x < 0 ? \"negative-infinite\" : \"positive-infinite\";
    369           break;
    370         case FP_NAN:
    371           /*FIXME A quiet nan can be distinguished by bit inspection*/
    372           name = \"signaling-nan\";
    373           break;
    374         case FP_NORMAL:
    375           name = x < 0 ? \"negative-normal\" : \"positive-normal\";
    376           break;
    377         case FP_SUBNORMAL:
    378           name = x < 0 ? \"negative-subnormal\" : \"positive-subnormal\";
    379           break;
    380         case FP_ZERO:
    381           name = signbit( x ) ? \"negative-zero\" : \"positive-zero\";
    382           break;
    383         default:
    384           name = \"unclassified\";
    385           break;
    386         }
    387         C_return( name );") ) ) )
     369      (lambda (num)
     370        ;
     371        (define C_fpclassify
     372          (foreign-lambda* symbol ((double x)) "
     373            char *name;
     374            switch (fpclassify( x )) {
     375            case FP_INFINITE:
     376              name = x < 0 ? \"negative-infinite\" : \"positive-infinite\";
     377              break;
     378            case FP_NAN:
     379              /*FIXME A quiet nan can be distinguished by bit inspection*/
     380              name = \"signaling-nan\";
     381              break;
     382            case FP_NORMAL:
     383              name = x < 0 ? \"negative-normal\" : \"positive-normal\";
     384              break;
     385            case FP_SUBNORMAL:
     386              name = x < 0 ? \"negative-subnormal\" : \"positive-subnormal\";
     387              break;
     388            case FP_ZERO:
     389              name = signbit( x ) ? \"negative-zero\" : \"positive-zero\";
     390              break;
     391            default:
     392              name = \"unclassified\";
     393              break;
     394            }
     395            C_return( name );"))
     396        ;
     397        (if (fp= -0.0 num)
     398          'negative-zero
     399          (C_fpclassify num) ) ) ) ) )
    388400
    389401;; Returns a symbol denoting the kind of floating-point number.
  • release/4/mathh/trunk/mathh.setup

    r34132 r34503  
    1111      (else     '() ) ) ) )
    1212
    13 (setup-shared+static-extension-module (extension-name) (extension-version "3.2.0")
     13(setup-shared+static-extension-module 'fp-utils (extension-version "3.2.1")
     14  #:inline? #t
     15  #:types? #t
     16  #:compile-options `(-scrutinize -optimize-level 3 -debug-level 1 -no-procedure-checks))
     17
     18(setup-shared+static-extension-module 'fx-utils (extension-version "3.2.1")
     19  #:inline? #t
     20  #:types? #t
     21  #:compile-options `(-scrutinize -optimize-level 3 -debug-level 1 -no-procedure-checks))
     22
     23(setup-shared+static-extension-module (extension-name) (extension-version "3.2.1")
    1424  #:inline? #t
    1525  #:types? #t
     
    1727  #:files '("mathh-constants.scm"))
    1828
    19 (setup-shared+static-extension-module 'mathh-consts (extension-version "3.2.0")
     29(setup-shared+static-extension-module 'mathh-consts (extension-version "3.2.1")
    2030  #:inline? #t
    2131  #:types? #t
    2232  #:compile-options `(-scrutinize -optimize-level 3 -debug-level 1 -no-bound-checks -no-argc-checks -no-procedure-checks))
    23 
    24 (setup-shared+static-extension-module 'fp-utils (extension-version "3.2.0")
    25   #:inline? #t
    26   #:types? #t
    27   #:compile-options `(-scrutinize -optimize-level 3 -debug-level 1 -no-procedure-checks))
    28 
    29 (setup-shared+static-extension-module 'fx-utils (extension-version "3.2.0")
    30   #:inline? #t
    31   #:types? #t
    32   #:compile-options `(-scrutinize -optimize-level 3 -debug-level 1 -no-procedure-checks))
  • release/4/mathh/trunk/tests/run.scm

    r34132 r34503  
    1 ;;;; mathh-test
    2 ;;;; Kon Lovett, May '17
    31
    4 ;;;; Issues
    5 ;;;;
     2(print "*** csi ***")
     3(system "csi -s mathh-test.scm")
    64
    7 (require-extension test)
    8 
    9 ;;;
    10 
    11 (require-extension mathh)
    12 
    13 ;;
    14 
    15 (test-group "ISO C Functions"
    16 
    17         (test 1.0 (bessel-j0 0.0))
    18         (test 0.0 (bessel-j1 0.0))
    19         (test 1.0 (bessel-jn 0 0.0))
    20         (test 0.0 (bessel-jn 1 0.0))
    21 
    22         (test 0.088256964215677 (bessel-y0 1.0))
    23         (test -0.781212821300289 (bessel-y1 1.0))
    24         (test 0.088256964215677 (bessel-yn 0 1.0))
    25         (test -0.781212821300289 (bessel-yn 1 1.0))
    26 
    27         (test 1.0 (cosh 0.0))
    28         (test 0.0 (sinh 0.0))
    29         (test 0.0 (tanh 0.0))
    30 
    31         (test 5.0 (hypot -5.0 0))
    32 
    33         (test 1.0 (tgamma 1.0))
    34         (test 0.0 (lgamma 1.0))
    35 
    36         (test 2.0 (log10 100.0))
    37         (test 3.0 (log2 8.0))
    38         (test 0.0 (log1p 0.0))
    39 
    40         (test 0.0 (fpmod 0.0 1.0))
    41 
    42         (test (values 5.0 0.5) (modf 5.5))
    43 
    44         (test 20.0 (ldexp 5.0 2))
    45 
    46         (test 20.0 (scalbn 5.0 2))
    47 
    48         (test (values 0.536870912 -30) (frexp 5.0e-10))
    49 )
    50 
    51 ;;
    52 
    53 (test-group "BSD Functions"
    54 
    55         (test-assert (signbit -1.0))
    56         (test-assert (not (signbit 1.0)))
    57         (test-assert (signbit -0.0))
    58 
    59         (test -1.0 (copysign 1.0 -1.0))
    60         (test 1.0 (copysign -1.0 1.0))
    61 
    62         (test 1.0 (nextafter 1.0 -1.0))
    63         (test -1.0 (nextafter -1.0 1.0))
    64 
    65         (test 2.4662 (cbrt 15.0))
    66 )
    67 
    68 ;;
    69 
    70 (test-group "Function fpclass"
    71 
    72         (test 'negative-infinite (fpclass -inf.0))
    73         (test 'signaling-nan (fpclass -nan.0))
    74         (test 'negative-zero (fpclass -0.0))
    75         (test 'positive-normal (fpclass 0.741573033707865))
    76         (test 'positive-normal (fpclass (fp/ 33.0 44.5)))
    77 )
    78 
    79 ;;
    80 
    81 (test-group "Function fpclassify"
    82 
    83         (test 'infinite (fpclassify -inf.0))
    84         (test 'nan (fpclassify -nan.0))
    85         (test 'zero (fpclassify -0.0))
    86         (test 'normal (fpclassify 0.741573033707865))
    87         (test 'normal (fpclassify (fp/ 33.0 44.5)))
    88 )
    89 
    90 ;;;
    91 
    92 (require-extension fp-utils)
    93 
    94 (define-constant 5eps (fp/ 9.0 1e06))
    95 (define-constant 4eps (fp/ 9.0 1e05))
    96 
    97 (test-group "FP Utils"
    98 
    99   (test-assert (fpzero? 0.0))
    100   (test-assert (not (fpzero? 1.0)))
    101   (test-assert (not (fpzero? maximum-flonum)))
    102   (test-assert (not (fpzero? minimum-flonum)))
    103 
    104   (test-assert (not (fppositive? 0.0)))
    105   (test-assert (not (fppositive? (fpneg minimum-flonum))))
    106   (test-assert (fppositive? maximum-flonum))
    107 
    108   (test-assert (fpcardinal? 0.0))
    109   (test-assert (not (fpcardinal? (fpneg minimum-flonum))))
    110   (test-assert (fpcardinal? maximum-flonum))
    111 
    112   (test-assert (not (fpnegative? 0.0)))
    113   (test-assert (fpnegative? (fpneg minimum-flonum)))
    114   (test-assert (not (fpnegative? maximum-flonum)))
    115 
    116         (test-assert (not (fpeven? 7.0)))
    117         (test-assert (fpeven? 6.0))
    118         (test-assert (not (fpodd? 6.0)))
    119         (test-assert (fpodd? 7.0))
    120 
    121         (test-assert (flonum? (fprandom)))
    122         (test-assert (flonum? (fprandom 2456)))
    123 
    124         (test 4.0 (fpadd1 3.0))
    125         (test 2.0 (fpsub1 3.0))
    126 
    127         (test 27.0 (fpcub 3.0))
    128 
    129         (test 1.0 (fpmodulo 5.0 2.0))
    130         (test 0.0 (fpmodulo 0.0 1.0))
    131 
    132         (test 2.0 (fpquotient 5.0 2.0))
    133         (test 1.0 (fpremainder 5.0 2.0))
    134 
    135         (test-assert (fp~= 0.123456 0.123457 5eps))
    136         (test-assert (fp~<= 0.123456 0.123457 5eps))
    137         (test-assert (fp~>= 0.123456 0.123457 5eps))
    138         (test-assert (fp~<= 0.123456 0.12346 5eps))
    139         (test-assert (fp~>= 0.123456 0.12344 5eps))
    140 
    141   (parameterize ((current-test-epsilon 4eps))
    142           (test 5.6568 (fpdistance 1.0 1.0 5.0 5.0)) )
    143 
    144         (receive (mx mn) (fpmax-and-min 1.0 -1.0 -16.0 13.0 2.0 16.0 7.0 -8.0)
    145           (test "fpmax-and-min max" 16.0 mx)
    146           (test "fpmax-and-min min" -16.0 mn) )
    147 )
    148 
    149 ;;;
    150 
    151 (require-extension fx-utils)
    152 
    153 (test-group "FX Utils"
    154 
    155   (test-assert (fxzero? 0))
    156   (test-assert (not (fxzero? 1)))
    157   (test-assert (not (fxzero? most-positive-fixnum)))
    158   (test-assert (not (fxzero? most-negative-fixnum)))
    159 
    160   (test-assert (not (fxpositive? 0)))
    161   (test-assert (not (fxpositive? most-negative-fixnum)))
    162   (test-assert (fxpositive? most-positive-fixnum))
    163 
    164   (test-assert (fxcardinal? 0))
    165   (test-assert (not (fxcardinal? most-negative-fixnum)))
    166   (test-assert (fxcardinal? most-positive-fixnum))
    167 
    168   (test-assert (not (fxnegative? 0)))
    169   (test-assert (fxnegative? most-negative-fixnum))
    170   (test-assert (not (fxnegative? most-positive-fixnum)))
    171 
    172         (test-assert (fixnum? (fxrandom)))
    173         (test-assert (fixnum? (fxrandom 2456)))
    174 
    175         (test 4 (fxadd1 3))
    176         (test 2 (fxsub1 3))
    177 
    178         (test 27 (fxcub 3))
    179 
    180         (test 8 (fxpow2log2 3))
    181 
    182         (test 16 (fxdistance 1 1 5 5))
    183 
    184         (receive (mx mn) (fxmax-and-min 1 -1 -16 13 2 16 7 -8)
    185           (test "fxmax-and-min max" 16 mx)
    186           (test "fxmax-and-min min" -16 mn) )
    187 )
    188 
    189 ;;;
    190 
    191 ;(import (prefix mathh-consts C:))
    192 ;(require-library mathh-consts)
    193 ;=> C:sqrt2 C:degree C:ln2 C:log2e C:e
    194 (require-extension mathh-consts)
    195 
    196 (test-group "Math Constants"
    197 
    198         ; Well, some
    199         (test sqrt2 (sqrt 2.0))
    200         (test degree (/ pi 180.0))
    201         (test ln2 (log 2.0))
    202         (test log2e (log2 e))
    203 )
    204 
    205 ;;;
    206 
    207 (test-exit)
     5;no -disable-interrupts
     6;NO -inline-global (real probs here w/ implicit)
     7(define *csc-options* "-scrutinize -optimize-leaf-routines -local -inline -specialize -unsafe -no-trace -no-lambda-info -clustering -lfa2")
     8(print "*** csc (" *csc-options* ") ***")
     9(system (string-append "csc" " " *csc-options* " " "mathh-test.scm"))
     10(system "./mathh-test")
Note: See TracChangeset for help on using the changeset viewer.