January 8, 201115 yr Commercial Member This is really a comment on something Bill said a long time ago and that I quote in the sd2gau series:-'`However, according to the nice folks at ACES, when dealing with boolean variables, the only value that can be guaranteed to be reliable is ZERO.’ He further goes on to comment that ACES never did explain why TRUE can equal either 1 or -1'.I stumbled across exactly the same statement ('the only value that can be guaranteed to be reliable is ZERO') in the Visual Studio 2008 help files, so it's not an ACES funny and again, there was no explanation as to why this should be so.-Dai
January 8, 201115 yr Commercial Member It's really simple... TRUE = anything but zero. FALSE = zero. As for the why's... machine language. Ed Wilson Mindstar AviationMy Playland - I69
January 8, 201115 yr In c# you get 3 possible values... true, false, null. Russian computers use to have 3 values as well. What I find even more confusing a function is suppose to return 0 if it succeeds...and hence those silly assert macros you have to use when doing any logic on the last HResult.
January 8, 201115 yr Moderator It is for that very reason of potential ambiguity that I take the time to guarantee that returned values are consistently predictable... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
January 8, 201115 yr Author Commercial Member It's really simple... TRUE = anything but zero. FALSE = zero. As for the why's... machine language.Sounds about right.. :( More years ago than I care to remember my first programming job was on an Intel MDS (Microprocessor Development System). It consisted mainly of flipping ones and zeros in a text-based visual interface that approximated the machine code underneath.... boring. The resulting EPROM was used to drive traffic light systems. It ceased to be completely boring just about the time I realised I could hack the code to prduce a disco display on the test rig. My boss was absolutely not amused when he saw it - right up to the point where he realised that I had unwittingly opened up the foreign market (different light sequencing). I still got a formal slap on the wrist for wasting company time, despite the fact that the company was now able to compete for (and win) a huge contract in Saudi Arabia. Different days, different ways.Oh yes - the MDS ran at an absolutely heady 4Khz. :( -Dai
Create an account or sign in to comment