Using an input of something other than 2.5 changes the middle two lines in some way in which I haven't yet discerned a pattern, but the result is still highly bogus.
Adding -std=gnu99 to the compile makes it work, it seems by selecting a different strtof implementation in /usr/include/stdlib.h. Maybe the gcc folks are interested, I dunno.
-Andy