Closed tedx closed 7 years ago
get_number_value has to return a double because double is the only type that can hold both 32-bit integers and 64-bit floats.
If you know you have an integer and you want the value as an integer, you can get call get_integer_value.
Wouldn't a long work for TYPE_INTEGER?
long would work too. On all platforms I've used in recent history, sizeof(long) == sizeof(int). Why do you ask?
Or are you asking why get_number_value() doesn't return a long? If so, the answer is, if get_number_value() was called on a TYPE_DOUBLE, how could a 'long' contain the fractional part of the number?
get_number_value on a node of type TYPE_INTEGER returns a double is this the expected behaviour?