ChaiScript math funcs

This is likely not due to just the math.hpp, but I have noticed this problem:

eval> cos(0)
Error: "Error with function dispatch with function 'cos'" With parameters: (const int) during evaluation at (1, 1)
eval> cos(0.0)

If I pass a number as an int to a function, it comes back with an error. I have to force the number to a floating point representation.

This seems like something my users would like do.

var theta = 45

And this would fail.

Is this a bug in the eval()?

You need to declare an automatic type conversion from int to float:

chai.add(type_conversion<int, float>());

Thank you - that does the job! (with the namespace included):

chai.add(chaiscript::type_conversion<int, float>());