BitCount of IBinaryInteger (and type conversion interface) #94386
Replies: 2 comments 7 replies
-
Not a language question. Moving up runtime. @tannergooding |
Beta Was this translation helpful? Give feedback.
-
This isn't relevant information. A type can opt to use many different underlying storage mechanisms, and so the number of bits available may not be well-defined ( Instead, there exists explicit APIs for reading/writing raw byte sequences given a well-defined two's complement format. These are the
In general, generic methods are expected to follow
Generic conversion operators are not possible to define, nor are they sufficient for covering the various intricacies of converting an arbitrary |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write a high-performance inline collection, but I'm encountering some problems.
I didn't find any property that can represent the bit count of
IBinaryInteger
. If there isn't, I think one should be added, or it can be provided through another interface.Also, the return value of
PopCount
is a generic type rather thanint
, which seems unreasonable? If it must return a generic type, then you might consider providing anexplicit
orimplicit
type conversion interface.Beta Was this translation helpful? Give feedback.
All reactions