Closed kbsriram closed 1 year ago
Thanks for bringing it up! I think the solution, as you suggest, is something along these lines:
static mp_float_t vector_sinc1(mp_float_t x) {
if (x == MICROPY_FLOAT_CONST(0.0)) {
return MICROPY_FLOAT_CONST(1.);
}
x *= MP_PI;
return MICROPY_FLOAT_C_FUN(sin)(x) / x;
}
If that's indeed the case, please, open a PR!
Describe the bug building ports/unix from CircuitPython results in a build error (tested close to current head at 8de9d5a52 - it uses ulab 6619c20)
To Reproduce
Results in the following error when running on an ubuntu machine
4.15.0-211-generic #222-Ubuntu SMP Tue Apr 18 18:55:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Additional context It looks like #617 introduced
fpclassify
rather thanMICROPY_FLOAT_CONST
for a comparison, which gives trouble for builds whereMICROPY_FLOAT
is a native double, and hasn't been explicitly overridden withMICROPY_FLOAT_IMPL_FLOAT
. If the simplest fix is just to useMICROPY_FLOAT_CONST(0.0)
here, lmk if you prefer a fix PR :-)