E
Erik Frey
Hi,
I'm writing a class that parses a file format that contains unsigned 32
bit integers. I've discovered that data types like UInt32 are not
CLS-compliant, and so I've been trying to figure out the best way to handle
this.
I could store them in Int64's (seems excessive, and presents problems
when trying to cast back to Int32 for function calls), or store them in
standard Int32's and have logical everywhere to check for Int32's that
evaluate "negative" and handle overflow...
There must be a better way to deal with this. And finally, why aren't
unsigned integers CLS-compliant!? I don't see what's so complicated or
nonstandard about that number format.
Thanks,
Erik
I'm writing a class that parses a file format that contains unsigned 32
bit integers. I've discovered that data types like UInt32 are not
CLS-compliant, and so I've been trying to figure out the best way to handle
this.
I could store them in Int64's (seems excessive, and presents problems
when trying to cast back to Int32 for function calls), or store them in
standard Int32's and have logical everywhere to check for Int32's that
evaluate "negative" and handle overflow...
There must be a better way to deal with this. And finally, why aren't
unsigned integers CLS-compliant!? I don't see what's so complicated or
nonstandard about that number format.
Thanks,
Erik