fix vm minf/maxf

This commit is contained in:
Irmen de Jong 2023-05-17 23:18:14 +02:00
parent b43223cb7a
commit c098ad2b3b
2 changed files with 14 additions and 3 deletions

View File

@ -124,6 +124,20 @@ sub rndseedf(float seed) {
}
sub minf(float f1, float f2) -> float {
if f1<f2
return f1
return f2
}
sub maxf(float f1, float f2) -> float {
if f1>f2
return f1
return f2
}
sub clampf(float value, float minimum, float maximum) -> float {
if value<minimum
value=minimum

View File

@ -14,9 +14,6 @@ For 9.0 major changes
- DONE: for loops now skip the whole loop if from value already outside the loop range (this is what all other programming languages also do)
- DONE: asmsub params or return values passed in cpu flags (like carry) now must be declared as booleans (previously ubyte was still accepted).
TODO: test min/max, floats.minf/maxf on all compiler targets
- [much work:] add special (u)word array type (or modifier such as @fast? ) that puts the array into memory as 2 separate byte-arrays 1 for LSB 1 for MSB -> allows for word arrays of length 256 and faster indexing
this is an enormous amout of work, if this type is to be treated equally as existing (u)word , because all expression / lookup / assignment routines need to know about the distinction....
So maybe only allow the bare essentials? (store, get, bitwise operations?)