Made with Drew

Go enthusiast

Division by Zero

Found some interesting idiosyncrasies while doing some floating point math. float64(1) / 0 // panic: division by zero float64(1) / float64(0) // panic: division by zero All good so far, then it gets more interesting. var f1 float64 f1 = float64(0) float64(1) / f1 // +Inf float64(0) / f1 // NaN It appears the compiler provides some safety when using static types, but does not provide the same benefit for variables.