How to use a floating point by using Fixed Point Alogrithm?
I know this is weird to ask, but how do you set a variable as a decimal without using the keywords float/double?
I ask this because when I am compiling the Kernel I get an error when I use float/double in the tcp_vegas.c file.
In Linux Kernel you cannot use floating point numbers for some reason, but you can do it. I know what I said just bare with me lol. I know you could use these functions:
However I got these errors:
So since I am getting these error and read some forums that I should avoid using kernel_fpu_begin(); and kernel_fpu_end();
ERROR: "__addsf3" [net/ipv4/tcp_vegas.ko] undefined
ERROR: "__muldf3" [net/ipv4/tcp_vegas.ko] undefined
ERROR: "__fixunsdfsi" [net/ipv4/tcp_vegas.ko] undefined
ERROR: "__floatsidf" [net/ipv4/tcp_vegas.ko] undefined
To see full details build your kernel with:
My next idea would be making a Fixed Point function, but I don't have a really clear idea on how to create that function.
I understand that
is the equation I am aiming for, but how does help me use a floating number?
If you could give me links of examples c code of fixed point function or anything related to that would be great. Also your knowledge/explanation too.