#incompatible types lossy conversation from double to int

13 messages ยท Page 1 of 1 (latest)

marble thistle
#

i got this error when i was going to make a switch idk what to do

tribal cradle
#

it means avr is a double

#

but switch can only work with ints

marble thistle
#

oh thanks lol

marble thistle
tribal cradle
#

you could

#

but note that comparing floating point numbers with == might not lead to expected results

#

e.g. you might result into situations like 0.0000000000001==0 which is false

marble thistle
#

๐Ÿ‘

tribal cradle
#

because 0.1+0.2 is 0.30000000000000004

brisk moss
#

if u really really REALLY want to stick to decimals look at what dana wrote ๐Ÿ™‚