Closed da-steve101 closed 8 years ago
Thinking about this a bit more, perhaps Flo and Dbl shouldn't override the colonEquals method? ie) I think this should be allowed:
myFlo := myUInt
Hence, colonEquals is always at the bit level, any conversions should be explicit. Thoughts?
You can currently do either myFlo := myFlo.fromBits(myUInt) myFlo := Flo().fromBits(myUInt)
Note, this requires, in general, that for x.myBits, x has no uninferred widths (as myUInt will be zero-extended as needed). In this specific case, Flo/myFlo has fully known widths so this is fine.
I think this satisfies your needs already?
Can one of the admins verify this patch?
I can understand why the assignment such as from UInt to Flo may be ambiguous in that either setting the bits directly or converting the integer to a floating point number.
For the case of setting the bits directly, this is a bit painful. All that is needed is access to the Bits colonEquals however, so I added equalsBits() which is this method but not overridden.