Weirdness of

Recently i was bitten by this weirdness of BigDecimal in Ruby. excepts initial value and number of significant digits. In one of my app, was called with string initial value without precision. Everything was working great and suddenly something changed. And this error started coming.

can't omit precision for a Float.

What happened was, the value passed to was no longer string. Due to some changes in other parts of code, float was passed to

Now when a float or rational is passed to, it requires precision to be present. Otherwise raises error.

can't omit precision for a Float(/Rational).

Fix was very simple. Pass the precision digits as second argument to the call.