Correctly handle Float -> BigDecimal with unspecified precision

Fixes #18122