Unsigned vars and indices for all vars
-
- Enthusiast
- Posts: 119
- Joined: Tue Feb 21, 2006 12:37 pm
Unsigned vars and indices for all vars
Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:36 pm, edited 1 time in total.
Re: Unsigned vars and indices for all vars
Although I agree with the request, I still think there are some casting problems. What would you do about this? Convert ulong to a long or long to an ulong?hellhound66 wrote: Fred posted, that there would be a casting problem. I say no. It is alway clear, what type a variable has, so it is clear, what castings need to be done.
Code: Select all
ulong.ul = 4294966000
long.l = -10000
Debug ulong
Debug long
If ulong > long
; And we have a problem...
EndIf
-
- Enthusiast
- Posts: 119
- Joined: Tue Feb 21, 2006 12:37 pm
Or at quad (or perhaps any level) when signed -v- unsigned comparison, check the sign of the signed var.
If this is negative then the signed var will always be less than and unequal to.
If this is positive then convert signed var to unsigned and compare.
As the compiler knows what is what at compile time it can cut the per-case code.
If this is negative then the signed var will always be less than and unequal to.
If this is positive then convert signed var to unsigned and compare.
As the compiler knows what is what at compile time it can cut the per-case code.
Dare2 cut down to size