How To Install rubygem-bigdecimal on CentOS 7

In this tutorial we learn how to install rubygem-bigdecimal on CentOS 7. rubygem-bigdecimal is BigDecimal provides arbitrary-precision floating point decimal

Introduction

In this tutorial we learn how to install rubygem-bigdecimal on CentOS 7.

What is rubygem-bigdecimal

Ruby provides built-in support for arbitrary precision integer arithmetic. For example 42**13 -> 1265437718438866624512 BigDecimal provides similar support for very large or very accurate floating point numbers. Decimal arithmetic is also useful for general calculation, because it provides the correct answers people expect–whereas normal binary floating point arithmetic often introduces subtle errors because of the conversion between base 10 and base 2.

We can use yum or dnf to install rubygem-bigdecimal on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install rubygem-bigdecimal.

Install rubygem-bigdecimal on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install rubygem-bigdecimal using yum by running the following command:

sudo yum -y install rubygem-bigdecimal

Install rubygem-bigdecimal on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install rubygem-bigdecimal using dnf by running the following command:

sudo dnf -y install rubygem-bigdecimal

How To Uninstall rubygem-bigdecimal on CentOS 7

To uninstall only the rubygem-bigdecimal package we can use the following command:

sudo dnf remove rubygem-bigdecimal

References

Summary

In this tutorial we learn how to install rubygem-bigdecimal on CentOS 7 using yum and dnf.