teuben / nemo

a Stellar Dynamics Toolbox (Not Everybody Must Observe)
https://astronemo.readthedocs.io
GNU General Public License v2.0
59 stars 42 forks source link

Unexpected rounding behavior in getiparam() #143

Open shubhambhatnag opened 7 months ago

shubhambhatnag commented 7 months ago

getiparam() rounds floating point numbers up to the nearing integer, instead of the C standard of flooring the value to the closest integer less than the floating point value.

Ex. int var = getiparam("c"); (Where c is 3.5) sets var to 4, instead of 3 as would be done with a cast to int in C.