Compare floating point expressions

I thought I had a simple expression in an if statement:

if c2c >= (r2 + r2) { 

but I couldn’t make it work until I replaced (r1 + r2) with a single variable.

https://play.golang.org/p/juhYJaoq5p

Am I missing something?

At first glance, your comments and your post here says r1 + r2 but your code (even the one you quote above) says r2 + r2.

1 Like

Thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.