Hi,
I would like to be able to use float or double data types in calculations but I get undefined reference errors such as:
undefined reference to `__mulsf3'
I'm confused because if you declare a double and perform a calulation it works fine, and you can observe the computed result while debugging.
Example that works:
double result = 0.0;
result = 1.2*1.3;
However, if you try to do the calculation using a variable the errors show up.
Example that won't compile:
double result = 0.0;
double x = 1.2;
double y = 1.3;
result = x*y;
If the first example is able to store the correct result then what am I missing here? Can someone please explain this to me?
Thanks!
EDIT: A release build will compile with the second example, but I haven't confirmed correct funcitionality. Why won't it compile as a debug build?
EDIT 2: The release build does not appear to execute that peice of code, looks like it has been thrown out without the compiler saying anything. What is going on with this SDK?
CSR1010 does not support float or double data types in runtime. As constant it works, since the compiler in your XIDE did it.
you must work in full byte or words.
One way of doing that is to multiply all by 10 or 100 and divide the end result.... if you must.
For example 3.14 *5.2 will become (314*52)/1000= 16
Thanks for your quick response Dr. Zur.
I assume there is no way to add floating-point support?
I presume that if you have a good C library you can.