-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/convert: fix conversion from float
Conversion from Go types big.Float, float32 and float64 always added an error to the OpContext even when no error had occured. Fixes #749 Closes #761 cuelang/cue#761 GitOrigin-RevId: 3476e9fc96bde56801c1cadda0004c529e70af39 Change-Id: I253846087ddaf5dbfd9bd2ade4cf917101e482e5 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8721 Reviewed-by: CUE cueckoo <cueckoo@gmail.com> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
3 changed files
with
56 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cue eval ./float.cue | ||
cmp stderr expect-stderr | ||
cmp stdout expect-stdout | ||
-- float.cue -- | ||
import "strconv" | ||
|
||
x : strconv.ParseFloat("3.14", 32) | ||
y : strconv.ParseFloat("3.14", 64) | ||
|
||
-- expect-stderr -- | ||
-- expect-stdout -- | ||
x: 3.140000104904175 | ||
y: 3.14 |
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