I am Trying to Round a number in my code which is as follows

param :a, 2, 5

param :b, 10, 49

param :extra1, 0, 3

@extra2 = @extra1 == 0 ? (1…3).choose : 0

@extra = [@extra1 , @extra2]

@coeff = []

(@extra.size).times{|i| @coeff[i] = @extra[i] == 0 ? (2…3).choose : 1 }

@num = @extra.last==0 ?

@extra.sum*Math::log10(@a):@extra.sum*Math::log10(@b)

@den1 = @coeff.first * Math::log10(@a)

@den2 = @coeff.last * Math::log10(@b)

@answer = @extra.last == 0 ? (-1*@num)/(@den1-@den2) :

(@num)/(@den1-@den2)

@answer = (@answer*100).round/100.to_f

And I am facing an " ‘round’: Infinity (FloatDomainError)". How can I

fix it.

Thanks for any Hints.

Raj