Floating point was only recently (past year?) "enabled". That does not mean anything is supposed to handle floating point right away, and printk is one of these.
The kernel has no need of floats; even where fractions are needed this is easily done in integer arithmetic. Specifically, the FPU will NEVER be used from within the kernel drivers on currently existing x86 family devices. If you want floats, you have to implement arithmetic routines yourself - that is, if no one has made a kernel patch with routines. You really need to put a lot of thought into why you'd want floats in a kernel routine.
Floating point was only
Floating point was only recently (past year?) "enabled". That does not mean anything is supposed to handle floating point right away, and printk is one of these.
From which kernel version
From which kernel version float calculation is suported?
Is there some header files that are necessary to use floating calculation ?
Can't precisely remember,
Can't precisely remember, I'm getting old! Must be at least two years now. No includes. As always, test it and you know whether it works or not.
But it does work in 2.6.23
But it does work in 2.6.23 — I just tried. See http://dev.medozas.de/gitweb.cgi?p=quad_dsp for an example. (WARNING: Violates at least two standard kernel practices.)
float
float a;
printk("a=%d.%d\n",(int)a,(int)(1000*(a-(int)a)));
No floats for you!
The kernel has no need of floats; even where fractions are needed this is easily done in integer arithmetic. Specifically, the FPU will NEVER be used from within the kernel drivers on currently existing x86 family devices. If you want floats, you have to implement arithmetic routines yourself - that is, if no one has made a kernel patch with routines. You really need to put a lot of thought into why you'd want floats in a kernel routine.
There is no legitimate
There is no legitimate reason to use floating point within the kernel. You are doing something wrong if you need floats.