mirror of
https://github.com/KarolS/millfork.git
synced 2025-08-07 12:25:40 +00:00
Document explicit bool conversions
This commit is contained in:
@@ -69,6 +69,14 @@ or forcing zero extension or sign extension:
|
|||||||
x = y // does zero extension and assigns value $0080
|
x = y // does zero extension and assigns value $0080
|
||||||
x = sbyte(y) // does sign extension and assigns value $FF80
|
x = sbyte(y) // does sign extension and assigns value $FF80
|
||||||
|
|
||||||
|
You can also explicitly convert expressions of type `bool` to any numeric type.
|
||||||
|
`false` is converted to 0 and `true` is converted to 1.
|
||||||
|
|
||||||
|
byte a,b,c
|
||||||
|
a = 5
|
||||||
|
b = byte(a == 4) // b is now equal to 0
|
||||||
|
c = byte(a == 5) // c is now equal to 1
|
||||||
|
|
||||||
## Typed pointers
|
## Typed pointers
|
||||||
|
|
||||||
For every type `T`, there is a pointer type defined called `pointer.T`.
|
For every type `T`, there is a pointer type defined called `pointer.T`.
|
||||||
|
Reference in New Issue
Block a user