Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-precision literals and using float and double together #3

Open
Photosounder opened this issue Jan 10, 2021 · 0 comments
Open

Comments

@Photosounder
Copy link

All real literals in fftpack.c are double precision such as 2.0 or 1.0, except in 4 different instances we have .5f instead which is a bit odd.

Also in case anyone is interested, since I needed to be able to do both float and double FFTs in the same program I took fftpack.c, branched it into fftpack_float.c and fftpack_double.c, removed fft_real_t, removed the c__1 and c__2 globals (I put them inside the functions that need them instead to avoid having the same globals declared twice), removed everything related to the complex keyword and the other pointless macros, replaced fft_complex_t with fft_complexf_t / fft_complexd_t, then for the single precision version I converted the trigonometry function calls and the literals to single precision, and minor things like using the value of pi instead of calculating it from atan, made separate header guards, gave function names suffixes, all so that you can include both fftpack_float.c and fftpack_double.c in the same C file as I did here without conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant