did I miss a note on floats in printf?
frank freedman
Posts: 1,983
I got an error on a simple piece of test code. Wondering if I missed something in the release notes...
no float in printf: link with -lm rounded == 0
the code is as copied from a book:
Frank
no float in printf: link with -lm rounded == 0
the code is as copied from a book:
Paste failed, but will edit later...outa time now.......
Frank
Comments
In order to avoid linking in the floating point code (which is quite large), the default version of printf does not support floats. To get it, you need to link with the math library. To do this add "-lm" to the end of your final link line, e.g.: If you're not actually linking, but just compiling all the .c files, it's still the same:
Eric
F
Yep, I did miss the memo. Right in the documents.......
F