Open hajimehoshi opened 1 year ago
Go 1.21 introduces min and max: https://tip.golang.org/ref/spec#Min_and_max
min
max
On the other hand, Kage already has min and max for scalar and vector values: https://ebitengine.org/en/documents/shader.html#Built-in_functions_(mathematics)
The point is
n/a
some typo Go 1.21 introduces min and max, not 1.12
Updated, thanks!
In GLSL, this is technically allowed:
min(vec2(0), 1.0)
Operating System
What feature would you like to be added?
Go 1.21 introduces
min
andmax
: https://tip.golang.org/ref/spec#Min_and_maxOn the other hand, Kage already has
min
andmax
for scalar and vector values: https://ebitengine.org/en/documents/shader.html#Built-in_functions_(mathematics)The point is
min
andmax
should take one or more arguments, not only two.min
andmax
should behave in the same way as Go's in terms of float numbers (NaN and -Inf).min
andmax
should return a constant-time value whenever possible. This means that this can be used as a length of an array for example.Why is this needed?
n/a