03Values and kinds
True and false
The two values မှန် and မမှန်, and where each comes from.
Some questions have just two possible answers. "Is 5 bigger than 3?" "Is it raining?"
A value that is either true or false is a boolean. Its kind is မှန်မှားတန်ဖိုး
("true/false value"); the loanword ဘူလီယန် means the same.
| Zaka | Reads as | Value |
|---|---|---|
မှန် | "right", "correct" | true |
မမှန် | "not right" | false |
စံကား
Expected output
မှန်
မမှန်
မှန်
မမှန်
Programs seldom write မှန် or မမှန် out. Most booleans come from
comparisons, and these drive decisions such as
if and else.
Endings
Like a verb, မှန် and မမှန် can take a polite ending. မှန်, မှန်သည်, မှန်ပါသည် all mean
"true". When an ending makes it a sentence, print it with ဟု:
စံကား
Expected output
မှန်
မမှန်
Hands on
- Print whether 10 equals 10, using
==. - Add
၁toမှန်. Read the message: booleans are not numbers.
Next: Text in quotes.