# Module decimal

## Data Types

### decimal()

decimal() = {integer(), integer()}

### old_decimal()

old_decimal() = {0 | 1, non_neg_integer(), integer()}

### opts()

opts() = #{precision => non_neg_integer(), rounding => rounding_algorithm()}

### rounding_algorithm()

rounding_algorithm() = round_floor | round_ceiling | round_half_up | round_half_down | round_down

## Function Index

 abs/1 add/2 cmp/3 divide/3 fast_cmp/2 is_zero/1 minus/1 mult/2 reduce/1 round/3 sub/2 to_binary/1 to_binary/2 to_decimal/2 to_decimal/3

## Function Details

### abs/1

abs(X1::decimal()) -> decimal()

### cmp/3

cmp(A::decimal(), B::decimal(), Opts::opts()) -> -1 | 0 | 1

### divide/3

divide(X1::decimal(), X2::decimal(), X3::opts()) -> decimal()

### fast_cmp/2

fast_cmp(X1, X2) -> any()

### is_zero/1

is_zero(X1::decimal()) -> boolean()

### minus/1

minus(X1::decimal()) -> decimal()

### mult/2

mult(X1::decimal(), X2::decimal()) -> decimal()

### reduce/1

reduce(X1::decimal()) -> decimal()

### round/3

round(Rounding::rounding_algorithm(), Decimal::decimal(), Precision::non_neg_integer()) -> decimal()

### sub/2

sub(A::decimal(), B::decimal()) -> decimal()

### to_binary/1

to_binary(Decimal::decimal()) -> binary()

### to_binary/2

to_binary(Decimal::decimal(), Opts) -> binary()

### to_decimal/2

to_decimal(Value, Opts) -> decimal()

### to_decimal/3

to_decimal(Base, Exp, Opts) -> decimal()

• Base = integer()
• Exp = integer()
• Opts = opts()

Generated by EDoc