tag:blogger.com,1999:blog-5246987755651065286.post8306889768907492220..comments2024-02-22T16:15:42.388-08:00Comments on cbloom rants: 06-02-10 - Some random Win64 junkcbloomhttp://www.blogger.com/profile/10714564834899413045noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5246987755651065286.post-83585226690239988732010-06-06T10:50:31.582-07:002010-06-06T10:50:31.582-07:00what about this?
for(uint x=N-1; x < N; --x)
...what about this?<br /><br />for(uint x=N-1; x < N; --x) <br /><br />one of the nice things about unsigned variables is that when the valid range is [0, N] you only have to do one comparison to check whether the value is inside.castanohttps://www.blogger.com/profile/08088335278984724562noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-90527632452402413362010-06-06T00:19:47.996-07:002010-06-06T00:19:47.996-07:00Which means you really want the loop index to be s...Which means you really want the loop index to be signed, which means you really want the variables you're comparing it to or initializing it from to be signed.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-51644279214250042852010-06-06T00:18:29.931-07:002010-06-06T00:18:29.931-07:00Unsigned integers are wrong for just about anythin...Unsigned integers are wrong for just about anything except if you're doing bit operations.<br /><br />My go-to demonstration of this is what happens when someone gives you an unsigned N and you want to do a for loop. for(uint x=0; x < N; ++x) does what you want for increasing, but for decreasing, for(uint x=N-1; x >= 0; --x) does not, instead you have to do crap with postdecrements in the comparison or something.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-8638156283508690612010-06-04T21:37:45.290-07:002010-06-04T21:37:45.290-07:00"I think x64 cl is in the right place, the co..."I think x64 cl is in the right place, the compiler is still a 32 bit app, it just cross-compiles to x64. "<br /><br />I don't think so. The one in x86_amd64 is a cross-compiler. The one in "amd64" is native 64 bit.cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-51733460800596037872010-06-04T18:03:40.651-07:002010-06-04T18:03:40.651-07:00I think x64 cl is in the right place, the compiler...I think x64 cl is in the right place, the compiler is still a 32 bit app, it just cross-compiles to x64.Scott Grahamhttps://www.blogger.com/profile/05856999162962423216noreply@blogger.com