Changeset 33018 in project


Ignore:
Timestamp:
12/20/15 17:49:31 (6 years ago)
Author:
Alex Shinn
Message:

Fixing edge case in binary formatting.

Location:
release/4/fmt
Files:
5 edited
7 copied

Legend:

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

    r26643 r33018  
    687687
    688688            (define (pad-all d i)
     689              (flush)
    689690              (cond
    690691               ((>= d base)
    691                 (flush/rounded))
    692                (else
    693                 (flush)
    694                 (write-digit d)))
     692                (write-digit 1)
     693                (set! d (- base d))
     694                (set! i (- i 1))))
     695              (write-digit d)
    695696              (let lp ((i (- i 1)))
    696697                (cond
  • release/4/fmt/tags/0.806/fmt.setup

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

    r26643 r33018  
    5858;; (test "1e-7" (fmt #f (num 1e-7)))
    5959;; (test "2e-6" (fmt #f (num 2e-6)))
     60(test "10" (fmt #f (num 2 2)))
    6061(test "57005" (fmt #f #xDEAD))
    6162(test "#xDEAD" (fmt #f (radix 16 #xDEAD)))
  • release/4/fmt/trunk/fmt.scm

    r26643 r33018  
    687687
    688688            (define (pad-all d i)
     689              (flush)
    689690              (cond
    690691               ((>= d base)
    691                 (flush/rounded))
    692                (else
    693                 (flush)
    694                 (write-digit d)))
     692                (write-digit 1)
     693                (set! d (- base d))
     694                (set! i (- i 1))))
     695              (write-digit d)
    695696              (let lp ((i (- i 1)))
    696697                (cond
  • release/4/fmt/trunk/fmt.setup

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

    r26643 r33018  
    5858;; (test "1e-7" (fmt #f (num 1e-7)))
    5959;; (test "2e-6" (fmt #f (num 2e-6)))
     60(test "10" (fmt #f (num 2 2)))
    6061(test "57005" (fmt #f #xDEAD))
    6162(test "#xDEAD" (fmt #f (radix 16 #xDEAD)))
Note: See TracChangeset for help on using the changeset viewer.