BigNum.new([value [,digits]])

Create a new BigNum variable. If no value is provided, the BigNum is initialized to 0 and 38 digits of precision (128 bits). The value can be a number value, a string that can be converted into a number, or another BigNum value. The acceptable values for precision are between 38 and 305 digits (128 to 1024 bits).

Values larger than 38 digits cannot be returned as a numeric value to the database because the numeric datatype is limited to 38 digits of precision. The value could, however, be returned as a varchar.

Example

a = BigNum.new()
a = BigNum.new(12345)
a = BigNum.new("8729384923242343242348239898.982983",100)
x = BigNum.new(a)