| 02-26-2004, 01:24 AM | #1 |
I'm trying to do a radix sort with jass to compensate for the slow down of using game cache. A number can be represented in multiple ways in jass. First its plain old integer form. ITs hex form using the 0x prefix. And its byte notation using the ' ' brackets. Let say we have the number 65. It can be represented as 65,0x41,and 'A' will all still have the same value. But as numbers grow bigger its harder to tell there values however it is easily concieved that it requires less pass throughs if you are using radixs as worse case you'll need four pass throughs with radixs for a 32 bit integer. As a hex number will have 8 hex digits, in plain numerical form 10 digits, but in char form it will only have 4 radixs. (example 'AAAA'=1094795585=0x41414141) Now reals are a bit trickier and depend on if Jass fallows normal float convention. Basically a real is a 32 bit (4 byte) number made up of 1 bit for the sign,8 bits for the biased exponent (always positive), and 23 bits are left for the matissa. Due to the fact that exponents are always positive and always come before the matissa, this means that greater exponentional (and thus larger numbers) will always have greater higher signifcant radixs. For your own proof use the RtoI return bug exploiter and you shall see that. Meaning its fine and dandy for an array of single signed reals to use the same operation of extracting in reverse order of radixs. But just how exactly would I extract least significant and subsequent radixs (each of the four bytes)? Also how does jass do negative integers (same signed way where the first bit is the one carrying the sign)? |
