print positive flonum exponents with "+"

original commit: bcf4dd26d268e25a89f24edc4ae7c75c97411c6d
This commit is contained in:
Matthew Flatt 2019-06-21 11:53:57 -06:00
parent d56e01edc9
commit 8479c4bebf
7 changed files with 25 additions and 24 deletions

View File

@ -790,7 +790,7 @@
(equal? (number->string 3.024) "3.024")
(eqv? (string->number (number->string #i2/3)) #i2/3)
(equal? (number->string 3.000) "3.0")
(equal? (number->string 3.2e20) "3.2e20")
(equal? (number->string 3.2e20) "3.2e+20")
(equal? (number->string 3.2e2) "320.0")
(equal? (number->string 3200000) "3200000")
(equal? (number->string 320000) "320000")
@ -848,7 +848,7 @@
(equal? (r6rs:number->string 3.024) "3.024")
(eqv? (string->number (r6rs:number->string #i2/3)) #i2/3)
(equal? (r6rs:number->string 3.000) "3.0")
(equal? (r6rs:number->string 3.2e20) "3.2e20")
(equal? (r6rs:number->string 3.2e20) "3.2e+20")
(equal? (r6rs:number->string 3.2e2) "320.0")
(equal? (r6rs:number->string 3200000) "3200000")
(equal? (r6rs:number->string 320000) "320000")

View File

@ -709,12 +709,12 @@
)
(mat fp-output
(equal? (number->string 1e23) "1e23")
(equal? (number->string 1e23) "1e+23")
(equal? (number->string 4.450147717014403e-308) "4.450147717014403e-308")
(equal? (number->string 1.1665795231290236e-302) "1.1665795231290236e-302")
; fp printing algorithm always rounds up on ties
(equal? (number->string 3.6954879760742188e-6) "3.6954879760742188e-6")
(equal? (number->string 5.629499534213123e14) "5.629499534213123e14")
(equal? (number->string 5.629499534213123e14) "5.629499534213123e+14")
)
(mat string->number

View File

@ -2242,7 +2242,7 @@
***************
*** 2175,2204 ****
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length)".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length #vu8() #vu8())".
@ -2273,7 +2273,7 @@
bytevector.mo:Expected error in mat bytevector-s8-set!: "bytevector-s8-set!: 3 is not a valid index for #vu8(3 4 5)".
--- 2175,2204 ----
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect number of arguments 0 to #<procedure bytevector-length>".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect number of arguments 2 to #<procedure bytevector-length>".
@ -3184,7 +3184,7 @@
*** 2892,2901 ****
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref)".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1)".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1 0)".
@ -3195,7 +3195,7 @@
--- 2892,2901 ----
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments 0 to #<procedure bytevector-u64-ref>".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments 1 to #<procedure bytevector-u64-ref>".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments 2 to #<procedure bytevector-u64-ref>".
@ -3207,7 +3207,7 @@
*** 2911,2921 ****
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set!)".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1)".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1 0)".
@ -3219,7 +3219,7 @@
--- 2911,2921 ----
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments 0 to #<procedure bytevector-s64-set!>".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments 1 to #<procedure bytevector-s64-set!>".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments 2 to #<procedure bytevector-s64-set!>".

View File

@ -2186,7 +2186,7 @@
***************
*** 2098,2127 ****
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length)".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length #vu8() #vu8())".
@ -2217,7 +2217,7 @@
bytevector.mo:Expected error in mat bytevector-s8-set!: "bytevector-s8-set!: 3 is not a valid index for #vu8(3 4 5)".
--- 2098,2127 ----
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect number of arguments to #<procedure bytevector-length>".
! bytevector.mo:Expected error in mat bytevector-length: "incorrect number of arguments to #<procedure bytevector-length>".
@ -3128,7 +3128,7 @@
*** 2815,2824 ****
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref)".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1)".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1 0)".
@ -3139,7 +3139,7 @@
--- 2815,2824 ----
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments to #<procedure bytevector-u64-ref>".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments to #<procedure bytevector-u64-ref>".
! bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect number of arguments to #<procedure bytevector-u64-ref>".
@ -3151,7 +3151,7 @@
*** 2834,2844 ****
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set!)".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1)".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1 0)".
@ -3163,7 +3163,7 @@
--- 2834,2844 ----
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments to #<procedure bytevector-s64-set!>".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments to #<procedure bytevector-s64-set!>".
! bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect number of arguments to #<procedure bytevector-s64-set!>".

View File

@ -2173,7 +2173,7 @@ bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 256".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -129".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length)".
bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length #vu8() #vu8())".
@ -2891,7 +2891,7 @@ bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: inv
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: invalid index 4.0 for bytevector #vu8(0 0 0 0 0 0 ...)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1 0)".
@ -2910,7 +2910,7 @@ bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: inv
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: invalid index 4.0 for bytevector #vu8(0 0 0 0 0 0 ...)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set!)".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1)".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1 0)".
@ -8818,7 +8818,7 @@ fx.mo:Expected error in mat fxsll: "fxsll: fixnum overflow with arguments -4097
fx.mo:Expected error in mat fxsll: "fxsll: fixnum overflow with arguments <-int> and 1".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: invalid shift count <int>".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: a is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: 1e23 is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: 1e+23 is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: <int> is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: invalid shift count -1".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: fixnum overflow with arguments 1 and <int>".

View File

@ -2143,7 +2143,7 @@ bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 256".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -129".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value -500".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 1e+100".
bytevector.mo:Expected error in mat bytevector: "bytevector: invalid value 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length)".
bytevector.mo:Expected error in mat bytevector-length: "incorrect argument count in call (bytevector-length #vu8() #vu8())".
@ -2861,7 +2861,7 @@ bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: inv
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: invalid index 4.0 for bytevector #vu8(0 0 0 0 0 0 ...)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-s64-ref: "bytevector-s64-ref: unrecognized endianness 1e+23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "incorrect argument count in call (bytevector-u64-ref $v1 0)".
@ -2880,7 +2880,7 @@ bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: inv
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: invalid index 4.0 for bytevector #vu8(0 0 0 0 0 0 ...)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness (quote bonkers)".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness get-real".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e23".
bytevector.mo:Expected error in mat bytevector-u64-ref: "bytevector-u64-ref: unrecognized endianness 1e+23".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set!)".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1)".
bytevector.mo:Expected error in mat bytevector-s64-set!: "incorrect argument count in call (bytevector-s64-set! $v1 0)".
@ -8766,7 +8766,7 @@ fx.mo:Expected error in mat fxsll: "fxsll: fixnum overflow with arguments -4097
fx.mo:Expected error in mat fxsll: "fxsll: fixnum overflow with arguments <-int> and 1".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: invalid shift count <int>".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: a is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: 1e23 is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: 1e+23 is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: <int> is not a fixnum".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: invalid shift count -1".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: fixnum overflow with arguments 1 and <int>".

View File

@ -1008,6 +1008,7 @@ floating point returns with (1 0 -1 ...).
(write-char (flonum-digit->char u) p)
(loop (cdr s))))))
(write-char #\e p)
(when (fxpositive? e) (write-char #\+ p))
(wrfixnum e r #t p)))
(define display-precision