Allow setting a suffix for constants and trigonometric functions#14
Allow setting a suffix for constants and trigonometric functions#14steffen-kiess wants to merge 1 commit intomborgerding:masterfrom
Conversation
|
Thanks for the input. I think this will improve accuracy for |
|
Comparing strings in the C preprocessor is rather difficult, especially because |
|
@steffen-kiess Could you put the above preprocessor hack into a PR? |
a10e9c4 to
63a6f80
Compare
|
I've updated this pull request. |
63a6f80 to
0b33f15
Compare
In order to use constants or trigonometric functions with a type other than
double, a suffix ('f' for float or 'l' for long double) has to be used in C.
This commit adds a preprocessor macro 'kiss_fft_suffix' which can be set to
either 'f' or 'l' and which will be added to floating point constants and to
the trigonometric functions (sin and cos).
Without this suffix, the code will use a too high precision for float and a
too low precision for long double.
0b33f15 to
5ebbc5e
Compare
|
The change was breaking |
|
Thanks for the update. Your preprocessor kung fu is strong. At times like this, I would reach for templates in a c++ project. I'll take a closer look and expect to merge this soon. |
This is similar to #12, but for the C version. The C version uses sin() and cos() and constants (for pi) which are not accurate enough for long double.
In order to use constants or trigonometric functions with a type other than
double, a suffix ('f' for float or 'l' for long double) has to be used in C.
This commit adds a preprocessor macro 'kiss_fft_suffix' which can be set to
either 'f' or 'l' and which will be added to floating point constants and to
the trigonometric functions (sin and cos).
Without this suffix, the code will use a too high precision for float and a
too low precision for long double.