Changeset 13762 in project
 Timestamp:
 03/14/09 21:31:58 (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

release/4/err5rsarithmetic/trunk/err5rsarithmeticfixnums.scm
r13716 r13762 168 168 fxpow2log2 169 169 fx=?# fx<?# fx>?# fx<=?# fx>=?# 170 fx# fx+# fx*# fx/#) 170 fx# fx+# fx*# fx/# 171 *fx= 172 *fx< 173 *fx> 174 *fx>= 175 *fx<= 176 *fx+ 177 *fx 178 *fx* 179 *fx/) 171 180 172 181 (import scheme … … 515 524 ;; 516 525 526 (definesyntax fx=?# 527 (syntaxrules () 528 ((_ ?x) 529 #t ) 530 ((_ ?x ?y) 531 (*fx= ?x ?y) ) 532 ((_ ?x ?y ?rest ...) 533 (and (*fx= ?x ?y) (fx=?# ?y ?rest ...)) ) ) ) 534 535 (definesyntax fx<?# 536 (syntaxrules () 537 ((_ ?x) 538 #t ) 539 ((_ ?x ?y) 540 (*fx< ?x ?y) ) 541 ((_ ?x ?y ?rest ...) 542 (and (*fx< ?x ?y) (fx<?# ?y ?rest ...)) ) ) ) 543 544 (definesyntax fx>?# 545 (syntaxrules () 546 ((_ ?x) 547 #t ) 548 ((_ ?x ?y) 549 (*fx> ?x ?y) ) 550 ((_ ?x ?y ?rest ...) 551 (and (*fx> ?x ?y) (fx>?# ?y ?rest ...)) ) ) ) 552 553 (definesyntax fx<=?# 554 (syntaxrules () 555 ((_ ?x) 556 #t ) 557 ((_ ?x ?y) 558 (*fx<= ?x ?y) ) 559 ((_ ?x ?y ?rest ...) 560 (and (*fx<= ?x ?y) (fx<=?# ?y ?rest ...)) ) ) ) 561 562 (definesyntax fx>=?# 563 (syntaxrules () 564 ((_ ?x) 565 #t ) 566 ((_ ?x ?y) 567 (*fx>= ?x ?y) ) 568 ((_ ?x ?y ?rest ...) 569 (and (*fx>= ?x ?y) (fx>=?# ?y ?rest ...)) ) ) ) 570 571 ;; 572 573 (definesyntax fx# 574 (syntaxrules () 575 ((_ ?x) 576 (*fxneg ?x) ) 577 ((_ ?x ?y) 578 (*fx ?x ?y) ) 579 ((_ ?x ?y ?rest ...) 580 (*fx ?x (fx# ?y ?rest ...) ) ) ) ) 581 582 (definesyntax fx+# 583 (syntaxrules () 584 ((_ ?x) 585 ?x ) 586 ((_ ?x ?y) 587 (*fx+ ?x ?y) ) 588 ((_ ?x ?y ?rest ...) 589 (*fx+ ?x (fx+# ?y ?rest ...) ) ) ) ) 590 591 (definesyntax fx*# 592 (syntaxrules () 593 ((_ ?x) 594 ?x ) 595 ((_ ?x ?y) 596 (*fx* ?x ?y) ) 597 ((_ ?x ?y ?rest ...) 598 (*fx* ?x (fx*# ?y ?rest ...) ) ) ) ) 599 600 (definesyntax fx/# 601 (syntaxrules () 602 ((_ ?x) 603 ?x ) 604 ((_ ?x ?y) 605 (*fx/ ?x ?y) ) 606 ((_ ?x ?y ?rest ...) 607 (*fx/ ?x (fx/# ?y ?rest ...) ) ) ) ) 608 609 # 610 ;; 611 517 612 (define (fx=?# fx . fxs) 518 613 (%checkfixnum 'fx=?# fx) … … 570 665 ((%null? (%cdr fxs)) (%fx/ fx (%car fxs))) 571 666 (else (%fxfold 'fx/# *fx/ fx fxs) ) ) ) 667 # 572 668 573 669 ) ;module err5rsarithmeticfixnums
Note: See TracChangeset
for help on using the changeset viewer.