Table of Contents

About

A three-valued logic implements a boolean as having three possible values:

  • true,
  • false
  • and some indeterminate third value.

Third value origin

This third value comes in play when you want to retrieve a Boolean from a storage where it may be just inexistant.

For instance, if we want to retrieve the value of a boolean attribute called bool from a JSON

  • In this case, the value is true
{
   "bool": true
}
  • In this case, the value is false
{
   "bool": false
}
{
}

Storage

You need only two bit to store this values:

  • 00: true
  • 01: false
  • 10: unknwon (that may internally be rebuild as a null value)

Example

Documentation / Reference