Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ansi-test
ansi-test
Commits
71fd482d
Commit
71fd482d
authored
Nov 26, 2019
by
Michał Herda
🤔
Committed by
Daniel Kochmański
Nov 26, 2019
Browse files
Add more cases to FORMAT.F.46
This ensures that 0.01 is printed the same way - as ".0" for ~2f, ~1f, and ~0f.
parent
91e61bee
Changes
1
Hide whitespace changes
Inline
Side-by-side
printer/format/format-f.lsp
View file @
71fd482d
...
...
@@ -559,9 +559,16 @@
(def-format-test format.f.45b
"~3f" (1.1) "1.1")
;; This fails on ECL 15.3.7
;;; Rationale for FORMAT.F.46: (format nil "~2f ~1f ~0f" 0.01 0.01 0.01) on SBCL
;;; 1.5.7 evaluates to ".0 .01 .01" which is enough for me to state that these
;;; three cases are not a part of one equivalence partition and that testing for
;;; these three cases explicitly is likely to find bugs in implementations:
;;; * ~2f is a case where the resulting float fits in the width;
;;; * ~1f is a case where the resulting float does not fit in the width;
;;; * ~0f is a case where the width is zero and therefore might be handled
;;; specially in the code.
(def-format-test format.f.46
"~0f" (0.01
) "
.0")
"
~2f ~1f
~0f" (0.01
0.01 0.01) ".0 .0
.0")
;; sbcl prints "."
(def-format-test format.f.46b
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment