Changeset 26346 in project
 Timestamp:
 04/02/12 22:06:36 (9 years ago)
 Location:
 release/4/numbers/trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

release/4/numbers/trunk/numbers.scm
r26345 r26346 1715 1715 (and e (if (not value) 1716 1716 0 1717 (if (> e +maximumallowedexponent+) 1718 (and (eq? exactness 'i) +inf.0) 1719 (%* value (expt 10 e)))))) 1717 (cond 1718 ((> e +maximumallowedexponent+) 1719 (and (eq? exactness 'i) +inf.0)) 1720 ((< e ( +maximumallowedexponent+)) 1721 (and (eq? exactness 'i) +0.0)) 1722 (else (%* value (expt 10 e))))))) 1720 1723 (let* ((len (##sys#size str)) 1721 1724 (r..9 (integer>char (fx+ (char>integer #\0) radix))) 
release/4/numbers/trunk/tests/numberstest.scm
r26344 r26346 761 761 (e2 (string>number "#e1.0e1000000")) 762 762 (t2 (currentseconds))) 763 (testassert "read time for inexacts isn't insanely high" (< ( t2 t1) 2)) 764 (test "numbers read back are equal" i1 i2) 763 (testassert "read time for inexacts with large positive exp isn't insanely high" (< ( t2 t1) 2)) 764 (test "inexact read back are equal" i1 i2) 765 (test "inexact are inf" i1 +inf.0) 766 (test "exact are equal" e1 e2) 767 (test "exact are false" e1 #f)) 768 (let* ((t1 (currentseconds)) 769 (i1 (string>number "1e1000000")) 770 (i2 (string>number "1.0e1000000")) 771 (e1 (string>number "#e1e1000000")) 772 (e2 (string>number "#e1.0e1000000")) 773 (t2 (currentseconds))) 774 (testassert "read time for inexacts with large negative exp isn't insanely high" (< ( t2 t1) 2)) 775 (test "inexact read back are equal" i1 i2) 776 (test "inexact are 0" i1 +0.0) 765 777 (test "exact are equal" e1 e2) 766 778 (test "exact are false" e1 #f))
Note: See TracChangeset
for help on using the changeset viewer.