mirror of
https://github.com/irmen/prog8.git
synced 2024-11-23 07:32:10 +00:00
upgr
This commit is contained in:
parent
dcba4f4098
commit
40f611664f
@ -57,5 +57,7 @@ min(), max() and clamp() are new builtin functions
|
|||||||
If you used symbols named ``min`` or ``max`` or ``clamp``, you have to choose a new name as these are now
|
If you used symbols named ``min`` or ``max`` or ``clamp``, you have to choose a new name as these are now
|
||||||
reserved for these new builtin functions.
|
reserved for these new builtin functions.
|
||||||
Code that uses an if statement and a comparison to determine the greater or lesser of two values,
|
Code that uses an if statement and a comparison to determine the greater or lesser of two values,
|
||||||
can now be optimized by just using one of these new builtin functions.
|
can now *sometimes* be optimized by just using one of these new builtin functions. (But sometimes
|
||||||
|
just using a simple if statement results in more efficient code. If your goal is fastest code,
|
||||||
|
compare both approaches!)
|
||||||
For floats, use ``floats.minf()``, ``floats.maxf()`` and ``floats.clampf()``.
|
For floats, use ``floats.minf()``, ``floats.maxf()`` and ``floats.clampf()``.
|
||||||
|
Loading…
Reference in New Issue
Block a user