Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Boolean true or false

Featured Replies

  • 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

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.

  • 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
  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.