'Var/10 = 0' instead '0.6'...

Good morning

I need your help once again.
Given var CursorPosActual_temp and temp...

int CursorPosActual_temp;
float temp;

Some simple math...

CursorPosActual_temp=6;
temp=CursorPosActual_temp/10;

doing...

Serial.println(temp);

Result on PC screen is '0.00'
Why do I have a result '0' instead '0.6' ?

I'll appreciate your help
Thanks on advance
Best regards

Pedro Ferrer

The conversion integer to float happens after the division, because 10 is considered an integer too. To force a conversion to float before the division, at least one part needs to be a float.

Try this instead:

temp=CursorPosActual_temp/10[glow].0[/glow];

Korman

Thanks Korman

I've forgot that issue!
I've already used before on same project...

Thanks once again
Best regards
Pedro Ferrer