1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-25 03:16:44 +00:00

Added constant-only functions min, max, if. Improved handling of constant-only functions.

This commit is contained in:
Karol Stasiak
2020-03-19 19:43:24 +01:00
parent 9cd1e47a37
commit 85030d3147
10 changed files with 150 additions and 48 deletions
+5 -1
View File
@@ -199,7 +199,7 @@ Fields of arithmetic, pointer and enum types are declared using normal expressio
Fields of struct types are declared using struct constructors.
Fields of union types cannot be declared.
What might be useful is the fact that the compiler allows for built-in trigonometric functions
What might be useful is the fact that the compiler allows for certain built-in functions
in constant expressions only:
* `sin(x, n)` returns _n_·**sin**(*x*π/128)
@@ -208,3 +208,7 @@ in constant expressions only:
* `tan(x, n)` returns _n_·**tan**(*x*π/128)
* `min(x,...)` returns the smallest argument
* `max(x,...)` returns the largest argument
+1 -1
View File
@@ -135,7 +135,7 @@ The `if` function returns its second parameter if the first parameter is defined
#infoeval if(0, 400, 500)
TODO
`not`, `lo`, `hi`, `+`, `-`, `*`, `|`, `&`, `^`, `||`, `&&`, `<<`, `>>`,`==`, `!=`, `>`, `>=`, `<`, `<=`
`not`, `lo`, `hi`, `min`, `max` `+`, `-`, `*`, `|`, `&`, `^`, `||`, `&&`, `<<`, `>>`,`==`, `!=`, `>`, `>=`, `<`, `<=`
The following Millfork operators and functions are not available in the preprocessor:
`+'`, `-'`, `*'`, `<<'`, `>>'`, `:`, `>>>>`, `nonet`, all the assignment operators