rescript-core
rescript-core copied to clipboard
Workaround for Math variadic functions
This ensures that the return for an empty array does not return -Infinity
TODO:
- [x] Update CHANGELOG
See https://github.com/rescript-association/rescript-core/issues/53
Might it be better to just remove the @variadic?
If you remove @variadic the compiler passes an array. Math.min([1, 2]) returns NaN
If you remove
@variadicthe compiler passes an array.Math.min([1, 2])returnsNaN
Ah, sorry, I didn't mean to include that. I checked after writing it, but apparently forgot to remove the comment. Please see the other comments instead :)
I was wondering and not sure if we should return 0.0. Maybe let returns Infinity.