Closed lovasoa closed 2 years ago
Thank you, this looks cool. Two things:
math::
prefix, since they seem to relate to those functions?is_float
function forward the error if the argument is not a float, as opposed to returning false in that case? I think it would make sense to be type-safer here.What purpose does the math::
prefix serve ? is_nan
is not really related to math, is it ? Why doesn't round
have this prefix ? There is no support for a module system or for namespaces, the math::
prefix seems to just be part of the function name; I'm not sure what its purpose is. I implemented the change anyway...
having the function return false
on non-float input makes them easier to use, at least in my usecase. I'll switch the behavior to what you suggest, but I'll have to add a new "typeof" function to get the type of a value in order to be able to implement the same behavior in the evalexpr expression itself.
@ISibboI : Is there something more you would like me to change before this can be merged ?
Thank you very much!
The idea behind putting the functions into modules without having a module system is that we can implement a module system without too large breaking changes.
Having floor, round and ceil as plain functions is likely a mistake.
The typeof function is a good idea!
I added the comment you wanted. Does it look ok to you now ?
Cool, thanks!
Thanks for merging !
Add support for is_nan, is_finite, and other floating-point testing functions