-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cue: float64 support for zero #1670
Conversation
Good catch. |
I will leave @mpvl to review the change itself, @kcburge, but just a comment on the DCO. The only requirement to assert the DCO is to include the trailer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvdan strange. Not sure what's going on here, because it looks ok to me. Indeed
@kcburge - please can you tweak the first line of the commit message per @mpvl's change to the title of this PR?
This is inline with the contribution guide on commit messages. Perhaps a force-push on the fixed commit message will also fix the DCO check... we'll see. |
@kcburge friendly ping about Paul's comment above, when you have the time :) That way we can import this change into Gerrit and merge it. If you don't have the time to do that in the next week or two, no worries - I can always take over this change for you if you'd prefer. |
Any update on this? Honestly, as nice as the idea/vision of CUE is, with issues like this it comes across as very flimsy and unusable in practice. 😔 |
8847831
to
c750c6f
Compare
Figured out the DCO error; the commit author had the email |
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 cue-lang#1669. Signed-off-by: Kevin Burge <kcburge@pm.me> Change-Id: I16a9fde39c36c519501c6cb3f87470a7f0cbab36
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 Float64() 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.
closes #1669
Signed-off-by: Kevin Burge kcburge@pm.me