Recommended Method for Converting Float to BigDecimal

BigDecimal says "It is not recommended to convert a floating point number to a decimal directly, as the floating point representation may be unexpected.". What is the recommended way of converting a float to a BigDecimal?
Was this page helpful?