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
}
- In this case, the value is unknown / indeterminate and map to a sort of missing value infomation
{
}
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)