S
Sergei Shelukhin
I am doing some manipulations with UInt16s and I know what I'm doing,
however the result of every calculations is int and I get tons of
Error Cannot implicitly convert type 'int' to 'ushort'. An explicit
conversion exists (are you missing a cast?)
in ridiculous places like (not the actual code)
UInt16 a, b;
....
b = a + 1; // error!
if ( a > 5 )
{
a -= 2; // error!
}
I know theoretically UInt16 might overflow, but so can int,
theoretically. I know what I'm doing and that UInt16 will not, in
fact, overflow (all input and calculations are checked on case by case
basis, as opposed to stupid blank errors that do not really guarantee
anything).
How do I get rid of this errors?
however the result of every calculations is int and I get tons of
Error Cannot implicitly convert type 'int' to 'ushort'. An explicit
conversion exists (are you missing a cast?)
in ridiculous places like (not the actual code)
UInt16 a, b;
....
b = a + 1; // error!
if ( a > 5 )
{
a -= 2; // error!
}
I know theoretically UInt16 might overflow, but so can int,
theoretically. I know what I'm doing and that UInt16 will not, in
fact, overflow (all input and calculations are checked on case by case
basis, as opposed to stupid blank errors that do not really guarantee
anything).
How do I get rid of this errors?