Dear friends,
I love mblock, using V5.4.3, but there’s something i can’t wrap my head around, and it’s this:
On https://www.arduino.cc/reference/en/language/variables/data-types/float/ it is stated that:
x = 1;
y = x / 2; // y now contains 0, ints can’t hold fractions
z = (float)x / 2.0; // z now contains .5 (you have to use 2.0, not 2)
Notes and Warnings
If doing math with floats, you need to add a decimal point, otherwise it will be treated as an int. See the Floating point constants page for details.
But i can’t seem to have the compiler include the .0: it simply doesnt see it.
In my original application i need the fraction part, when i copy and paste the preview code into IDE and manually add the .0 my application works fine, but that kinda defeats the purpose of mblock
Any suggestions?