This does away with use of long doubles for calculations with the sample rate. In the C library, this was used in digital_rf_get_subdir_file to determine file names and sample bounds. The np.longdouble sample rate was similarly used in the Python library to get the list of files containing a given sample index range.
The reason for this change is that not all platforms support long doubles with at least a 64-bit mantissa. This caused at least one bug on the aarch64 platform which resulted in incorrect file bounds from digital_rf_get_subdir_file. By using integer math that is implemented uniformly on all platforms, any bugs in the calculation should be more noticeable.
This commit also adds two new functions to the C API: digital_rf_get_timestamp_floor and digital_rf_get_sample_ceil. These are now used to do the file sample bound calculations, and they are exposed so that users of the library can perform these calculations in a way that is consistent with what is done internally. These functions have also been exposed in the Python binding, and a test that verifies that the sample index round-trips through them is included in the Python testing suite.
Because of the added C functions, the library version has been bumped to 2.7, which means the next release of Digital RF will be 2.7.0.
This does away with use of
long double
s for calculations with the sample rate. In the C library, this was used indigital_rf_get_subdir_file
to determine file names and sample bounds. Thenp.longdouble
sample rate was similarly used in the Python library to get the list of files containing a given sample index range.The reason for this change is that not all platforms support
long double
s with at least a 64-bit mantissa. This caused at least one bug on the aarch64 platform which resulted in incorrect file bounds fromdigital_rf_get_subdir_file
. By using integer math that is implemented uniformly on all platforms, any bugs in the calculation should be more noticeable.This commit also adds two new functions to the C API:
digital_rf_get_timestamp_floor
anddigital_rf_get_sample_ceil
. These are now used to do the file sample bound calculations, and they are exposed so that users of the library can perform these calculations in a way that is consistent with what is done internally. These functions have also been exposed in the Python binding, and a test that verifies that the sample index round-trips through them is included in the Python testing suite.Because of the added C functions, the library version has been bumped to 2.7, which means the next release of Digital RF will be 2.7.0.