object

# number

> Number data type predicates.

author:
  `Paulo Moura`
version:
  `1.5`
date:
  `2018/7/14`

compilation flags:
  `static, context_switching_calls`

extends:
  `public atomic`

## Public interface

### approximately_equal/3

> Compares two numbers for approximate equality given an epsilon value using the de facto standard formula abs(Number1 - Number2) =< max(abs(Number1), abs(Number2)) * Epsilon. No type-checking.

compilation flags:
  `static`
template:
  `approximately_equal(Number1,Number2,Epsilon)`
mode – number of proofs:
  `approximately_equal(+number,+number,+number) – zero_or_one`

### essentially_equal/3

> Compares two numbers for essential equality given an epsilon value using the de facto standard formula abs(Number1 - Number2) =< min(abs(Number1), abs(Number2)) * Epsilon. No type-checking.

compilation flags:
  `static`
template:
  `essentially_equal(Number1,Number2,Epsilon)`
mode – number of proofs:
  `essentially_equal(+number,+number,+number) – zero_or_one`

### tolerance_equal/4

> Compares two numbers for close equality given relative and absolute tolerances using the de facto standard formula abs(Number1 - Number2) =< max(RelativeTolerance * max(abs(Number1), abs(Number2)), AbsoluteTolerance). No type-checking.

compilation flags:
  `static`
template:
  `tolerance_equal(Number1,Number2,RelativeTolerance,AbsoluteTolerance)`
mode – number of proofs:
  `tolerance_equal(+number,+number,+number,+number) – zero_or_one`

### =~= / 2

> Compares two floats (or lists of floats) for approximate equality using 100*epsilon for the absolute error and, if that fails, 99.999% accuracy for the relative error. Note that these precision values may not be adequate for all cases. No type-checking.

compilation flags:
  `static`
template:
  `=~=(Float1,Float2)`
mode – number of proofs:
  `=~=(+number,+number) – zero_or_one`
  `=~=(+list(number),+list(number)) – zero_or_one`

## Protected interface

(see related entities)

## Private predicates

(see related entities)

## Operators

### op(700,xfx,=~=) (public)

## Remarks

### (none)

## See also

### (none)