Function

NumCosmoMathcmp

Declaration [src]

gint
ncm_cmp (
  gdouble x,
  gdouble y,
  const gdouble reltol,
  const gdouble abstol
)

Description [src]

Compares x and y, which are equal when $|x - y| \leq \epsilon_\mathrm{rel} \max(|x|, |y|) + \epsilon_\mathrm{abs}$. If one of them is zero, $\max(|x|, |y|)$ is replaced by one, so reltol also acts as an absolute tolerance.

Parameters

x

Type: gdouble

A double.

y

Type: gdouble

A double.

reltol

Type: const gdouble

Relative tolerance.

abstol

Type: const gdouble

Absolute tolerance.

Return value

Type: gint

$-1$ if $x < y$, $0$ if they are equal, $1$ if $x > y$.