03-19-2010 05:05 PM
I'm trying to use the MicroBlaze under 11.4 to parse strings to floating point numbers. The MicroBlaze I have is NOT configured with an FPU, so the conversions are being done entirely using the software floating point libraries. As an example of how I'm seeing atof and strtod fail, the following code prints "1072168960.000000" to the console:
double f = atof("0.75");
Is there some sort of esoteric GCC command line option that is needed? Or is the stdlib code provided for the MicroBlaze simply incapable of software floating point string conversions? In contrast, software floating point arithmetic and floating point conversion TO strings works just fine. Only conversions from strings fails.
Thanks for any insight.
03-19-2010 05:34 PM
I was originally including math.h in the file that was performing the string conversion, but when I removd the math.h include, the conversion now works just fine. Doesn't make sense, but at least it works now.
05-26-2018 11:52 PM
I have same problem with you with vivado 2018 using Digilent Cmod A7, but after I insert
in my program, the problem is gone and the atof function works properly!