-
• #2
Unfortunately the FPU isn't really used, no.
The issue is that the JavaScript says that basically all maths should be done using
double
- so there are very few points where floats can be used - and it makes very little sense to include two sets of maths functions for float and double in such a constrained device.Realistically you'll find that if you're using JS the execution overhead of JS is far greater than that of dealing with doubles, so your issue is what makes the most efficient use of memory (and for that, Int16Array wins).
Hi All,
Is the FPU of the nRF52 utilised when working with 32 bit floats?
I would like to find the most efficient method to process data from the accelerometer and I'm a bit confused at the moment:
Bangle.getAccel()
returns floating point values already converted to g. It's not clear though if these should be considered asfloat
ordouble
in terms of C.Int16Array
. However, one might think that aFloat32Array
would be more straightforward and efficient to avoid conversions.I'm new to Espruino/JS and I might be confused by how C types are converted in Espruino. Could someone advise me the best approach?
Thanks,
-Tamás