modular-arithmetic

Check-in [8bb517f3c0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Ported the egg to CHICKEN 5
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | chicken-5
Files: files | file ages | folders
SHA3-256: 8bb517f3c0f67eb6402040bb5bc9ef898740d8cab02ab063727aa36f10db52ec
User & Date: murphy 2018-08-18 16:26:17
Context
2018-08-18
16:30
Added release information file check-in: b47b80eccd user: murphy tags: chicken-5
16:26
Ported the egg to CHICKEN 5 check-in: 8bb517f3c0 user: murphy tags: chicken-5
15:58
imported v1.0.2 Leaf check-in: 0850058f44 user: murphy tags: trunk, v1.0.2
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Name change from modular-arithmetic.meta to modular-arithmetic.egg.

     1         -((egg "modular-arithmetic.egg")
     2         - (files "modular-arithmetic.setup" "modular-arithmetic.meta" "modular-arithmetic.release-info" "modular-arithmetic.scm" "tests/run.scm")
     3         - (needs numbers matchable)
     4         - (test-depends test)
     5         - (category math)
            1  +((category math)
     6      2    (synopsis "Modular Arithmetic on Finite Fields")
     7      3    (author "Thomas Chust")
     8         - (doc-from-wiki)
     9         - (license "BSD"))
            4  + (license "BSD")
            5  + (version "1.0.3")
            6  + (dependencies srfi-1 matchable)
            7  + (test-dependencies test)
            8  + (components
            9  +   (extension modular-arithmetic)))
           10  +
           11  +;; vim: set ai et ts=8 sts=2 sw=2 ft=scheme: ;;

Changes to modular-arithmetic.scm.

     1         -(require-library
     2         - srfi-1
     3         - numbers matchable)
     4         -
     5      1   (module modular-arithmetic
     6      2     (xgcd mod+ mod- mod* mod/ modexpt with-modulus)
     7      3     (import
     8         -   (except scheme
     9         -	   + - * / = > < >= <=
    10         -	   number->string string->number
    11         -	   exp log sin cos tan asin acos atan expt sqrt
    12         -	   quotient modulo remainder numerator denominator
    13         -	   abs max min gcd lcm
    14         -	   positive? negative? odd? even? zero? exact? inexact?
    15         -	   floor ceiling truncate round
    16         -	   inexact->exact exact->inexact
    17         -	   number? complex? real? rational? integer?
    18         -	   real-part imag-part magnitude)
    19         -   (except chicken
    20         -	   add1 sub1 signum
    21         -	   bitwise-and bitwise-ior bitwise-xor bitwise-not
    22         -	   arithmetic-shift)
    23         -   srfi-1
    24         -   numbers)
            4  +    scheme
            5  +    (chicken base)
            6  +    (chicken bitwise)
            7  +    srfi-1)
    25      8     (import-for-syntax
    26         -   scheme chicken matchable)
            9  +    scheme
           10  +    (chicken base)
           11  +    matchable)
    27     12   
    28     13   ;; Extended GCD
    29     14   (define (xgcd a b)
    30     15     (let-values ([(q m) (quotient&modulo a b)])
    31     16       (if (zero? m)
    32     17   	(values 0 1)
    33     18   	(let-values ([(x y) (xgcd b m)])
................................................................................
    94     79   			[sub1 (lambda (n) (- n 1))]
    95     80   			[* (,(rename 'mod*) ,~modulus)]
    96     81   			[/ (,(rename 'mod/) ,~modulus)]
    97     82   			[expt (,(rename 'modexpt) ,~modulus)])
    98     83                  ,@body)))]))))
    99     84   
   100     85   )
           86  +
           87  +;; vim: set ai et ts=8 sts=2 sw=2 ft=scheme: ;;

Deleted modular-arithmetic.setup.

     1         -(compile -s -O2 -d1 "modular-arithmetic.scm" -j modular-arithmetic)
     2         -(compile -c -O2 -d1 "modular-arithmetic.scm" -j modular-arithmetic -unit modular-arithmetic)
     3         -(compile -s -O2 -d0 "modular-arithmetic.import.scm")
     4         -
     5         -(install-extension
     6         - 'modular-arithmetic
     7         - '("modular-arithmetic.so" "modular-arithmetic.o" "modular-arithmetic.import.so")
     8         - '((version 1.0.2)
     9         -   (static "modular-arithmetic.o")))

Changes to tests/run.scm.

     1         -(require-extension
     2         - test modular-arithmetic)
            1  +(import
            2  +  modular-arithmetic test)
     3      3   
     4      4   (test-group "Modular Arithmetic"
     5      5   
     6      6     (test "Extended GCD"
     7      7       '(3 -2)
     8      8       (receive (xgcd 15 21)))
     9      9