mirror of
https://github.com/irmen/prog8.git
synced 2025-01-26 19:30:59 +00:00
fix vm minf/maxf
This commit is contained in:
parent
b43223cb7a
commit
c098ad2b3b
@ -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
|
||||
|
@ -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?)
|
||||
|
Loading…
x
Reference in New Issue
Block a user