Javier Mora
Javier Mora
> `// when the input number is an integer type, do all math as 32 bit signed long` Oh yes; I forgot that. If you don't cast to long, an...
See #28
The thing is, Arduino is not standard C++, but some sort of language of its own that is based on C++ but introduces some simplifications. Among other things, it creates...
> Not everything you take for granted as working perfectly well in the modern versions of avr-libc was always so reliable. In fact, `round` was not even a standard C++...
> The math library with the round function (with floating point parameter and floating point return) is at least C99 Well yes, but Arduino is based on C++, not C....
> One possible fix might look like this: > ``` > #define round(x) ({ \ > typeof(x) _x = (x); \ > (_x>=0) ? (long)(_x+0.5) : (long)(_x-0.5); \ > })...
> I just tested the sketch size occupation and, with my biggest disbelief, the math.h version produces way smaller binaries than the macro version @facchinm, I don't know what's going...
I think I'm with @qinqingege on this one. This is not about removing the `[]` functionality as @PaulStoffregen says but about making it more array-like. Why can you do ```arduino...
As a workaround, use `(floor)(x)` and `(ceil)(x)`, which will not use the macro but the actual function. Alternatively, you can create a new tab in your Arduino project with a...
...well, I did say it was a workaround, didn't I? :) In any case I think Arduino.h will eventually have to be purged from macros and instead use standard C++...