Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

BUG: Inconsistent behavior with float and float32, float64 #252

Closed
rudolph9 opened this issue Jan 7, 2020 · 2 comments
Closed

BUG: Inconsistent behavior with float and float32, float64 #252

rudolph9 opened this issue Jan 7, 2020 · 2 comments

Comments

@rudolph9
Copy link
Contributor

rudolph9 commented Jan 7, 2020

cue version 0227ac0

myFloatAndIntZero: float & 0
myFloatAndIntOne: float & 1
myFloatAndFloatZero: float & 0.0
myFloatAndFloatOne: float & 1.0
myFloat32AndIntZero: float32 & 0
myFloat32AndIntOne: float32 & 1
myFloat32AndFloatZero: float32 & 0.0
myFloat32AndFloatOne: float32 & 1.0
myFloat64AndIntZero: float64 & 0
myFloat64AndIntOne: float64 & 1
myFloat64AndFloatZero: float64 & 0.0
myFloat64AndFloatOne: float64 & 1.0
:!cue eval % --all --ignore
myFloatAndIntZero:     _|_ // conflicting values float and 0 (mismatched types float and int)
myFloatAndIntOne:      _|_ // conflicting values float and 1 (mismatched types float and int)
myFloatAndFloatZero:   0.0
myFloatAndFloatOne:    1.0
myFloat32AndIntZero:   0
myFloat32AndIntOne:    1
myFloat32AndFloatZero: 0.0
myFloat32AndFloatOne:  1.0
myFloat64AndIntZero:   0
myFloat64AndIntOne:    1
myFloat64AndFloatZero: 0.0
myFloat64AndFloatOne:  1.0

I haven't verified this but It appears that declaring something float32|float64 only makes the value number with a range constraint, not the more constrained value float with a range.

@rudolph9
Copy link
Contributor Author

rudolph9 commented Jan 7, 2020

Opening new ticket that proposes unifying some more fundamental aspects of cue.

@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#252.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants