Changeset 33019 in project


Ignore:
Timestamp:
12/20/15 18:14:33 (6 years ago)
Author:
Alex Shinn
Message:

more binary edge cases

Location:
release/4/fmt
Files:
3 edited
9 copied

Legend:

Unmodified
Added
Removed
  • release/4/fmt/tags/0.807/fmt.scm

    r33018 r33019  
    690690              (cond
    691691               ((>= d base)
    692                 (write-digit 1)
     692                (write-digit )
    693693                (set! d (- base d))
    694694                (set! i (- i 1))))
     
    848848
    849849            (cond
     850             ((and (= 2 base) (integer? n))
     851              (if prefix (display prefix port))
     852              (display (number->string n 2) port))
    850853             ((negative? e)
    851854              (if (or (= e *min-e*) (not (= f *bot-f*)))
  • release/4/fmt/tags/0.807/fmt.setup

    r33018 r33019  
    1 (define version "0.806")
     1(define version "0.807")
    22
    33(compile -s -O2 -d0 -j fmt -o fmt.so fmt-chicken.scm)
  • release/4/fmt/tags/0.807/test-fmt.scm

    r33018 r33019  
    5858;; (test "1e-7" (fmt #f (num 1e-7)))
    5959;; (test "2e-6" (fmt #f (num 2e-6)))
     60(test "0" (fmt #f (num 0 2)))
     61(test "1" (fmt #f (num 1 2)))
    6062(test "10" (fmt #f (num 2 2)))
     63(test "11" (fmt #f (num 3 2)))
     64(test "100" (fmt #f (num 4 2)))
     65(test "-1" (fmt #f (num -1 2)))
     66(test "-10" (fmt #f (num -2 2)))
     67(test "1.1" (fmt #f (num 1.5 2)))
    6168(test "57005" (fmt #f #xDEAD))
    6269(test "#xDEAD" (fmt #f (radix 16 #xDEAD)))
  • release/4/fmt/trunk/fmt.scm

    r33018 r33019  
    690690              (cond
    691691               ((>= d base)
    692                 (write-digit 1)
     692                (write-digit )
    693693                (set! d (- base d))
    694694                (set! i (- i 1))))
     
    848848
    849849            (cond
     850             ((and (= 2 base) (integer? n))
     851              (if prefix (display prefix port))
     852              (display (number->string n 2) port))
    850853             ((negative? e)
    851854              (if (or (= e *min-e*) (not (= f *bot-f*)))
  • release/4/fmt/trunk/fmt.setup

    r33018 r33019  
    1 (define version "0.806")
     1(define version "0.807")
    22
    33(compile -s -O2 -d0 -j fmt -o fmt.so fmt-chicken.scm)
  • release/4/fmt/trunk/test-fmt.scm

    r33018 r33019  
    5858;; (test "1e-7" (fmt #f (num 1e-7)))
    5959;; (test "2e-6" (fmt #f (num 2e-6)))
     60(test "0" (fmt #f (num 0 2)))
     61(test "1" (fmt #f (num 1 2)))
    6062(test "10" (fmt #f (num 2 2)))
     63(test "11" (fmt #f (num 3 2)))
     64(test "100" (fmt #f (num 4 2)))
     65(test "-1" (fmt #f (num -1 2)))
     66(test "-10" (fmt #f (num -2 2)))
     67(test "1.1" (fmt #f (num 1.5 2)))
    6168(test "57005" (fmt #f #xDEAD))
    6269(test "#xDEAD" (fmt #f (radix 16 #xDEAD)))
Note: See TracChangeset for help on using the changeset viewer.