I'm trying to learn Go and working on a rain intensity tool. For this tool I have to make a calculation like this:
var intensity float32
intensity = 10^((value−109)÷32)
The value is an uint8
, ranging from 0 to 255. The intensity variable is a float.
However, Go tells me that
cannot use 10 ^ (value - 109) / 32 (type uint8) as type float32 in assignment
How can I solve this?