The function "convert_str_time" to convert string (ex "12ps") into frame number providing a dt (in ps) can give a wrong result for non integer dt. For example:
- convert_str_time("10ps", 1) gives 10, as expected
- convert_str_time("1ps", 0.1) gives 9
The reason behind is a floating point error: 1//0.1 = 9.
The function "convert_str_time" to convert string (ex "12ps") into frame number providing a dt (in ps) can give a wrong result for non integer dt. For example:
The reason behind is a floating point error: 1//0.1 = 9.