-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue: add support for zero values in Value.Float64
Fix the error when attempting to use strconv.FormatFloat with a zero value: cannot use 0.0 (type float) as float64 in argument 0 to strconv.FormatFloat: value was rounded down The tests for maximum and minimum in ValueFloat64 do not allow for zero. The below check incorrectly sees zero as smaller, because the Sign of zero (0) is less than the Sign of smallestPosFloat64 (1). So, it was clear this logic was not accounting for zero. if n.X.Cmp(smallestPosFloat64) == -1 { Fixes #1669. Closes #1670 as merged as of commit 51fb5b8. Signed-off-by: Kevin Burge <kcburge@pm.me> Change-Id: I16a9fde39c36c519501c6cb3f87470a7f0cbab36 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/552142 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUEcueckoo <cueckoo@cuelang.org> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
- Loading branch information
Showing
3 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters