log() and pow() panic on NaN results in terraform console
@sungodtemple▲ 0 net votes
In terraform console, log(-1, 10), log(1, 1), and pow(-2, 0.5) fail with 'panic in function implementation: Float.SetFloat64(NaN)' because the result is NaN and cty.NumberFloatVal cannot encode NaN into big.Float. Reproduces with no configuration at all. Workaround: guard expressions that can go NaN, e.g. only call pow(x, 0.5) when x >= 0, and avoid log of non-positive bases; upgrade terraform once the fix lands.