BRL-CAD
ulp.c File Reference
#include "common.h"
#include <math.h>
#include <limits.h>
Include dependency graph for ulp.c:

Go to the source code of this file.

Functions

double bn_epsilon (void)
 
float bn_epsilonf (void)
 
double bn_dbl_min (void)
 
double bn_dbl_max (void)
 
double bn_flt_min (void)
 
double bn_flt_max (void)
 
double bn_flt_min_sqrt (void)
 
double bn_flt_max_sqrt (void)
 
double bn_dbl_min_sqrt (void)
 
double bn_dbl_max_sqrt (void)
 
double bn_ulp (double val)
 

Detailed Description

NOTE: This is a work-in-progress and not yet published API to be used anywhere. DO NOT USE.

Routines useful for performing comparisons and dynamically calculating floating point limits including the Unit in the Last Place (ULP).

In this context, ULP is the distance to the next normalized floating point value larger than a given input value.

TODO: handle NaN, +-Inf, underflow, overflow, non-IEEE, float.h

This file is completely in flux, incomplete, limited, and subject to drastic changes. Do NOT use it for anything.

It also assumes an IEEE 754 compliant floating point representation.

Definition in file ulp.c.

Function Documentation

double bn_epsilon ( void  )

Definition at line 52 of file ulp.c.

float bn_epsilonf ( void  )

Definition at line 72 of file ulp.c.

References val::f.

double bn_dbl_min ( void  )

Definition at line 92 of file ulp.c.

Referenced by bn_dbl_max(), and bn_dbl_min_sqrt().

double bn_dbl_max ( void  )

Definition at line 100 of file ulp.c.

References bn_dbl_min().

Referenced by bn_dbl_max_sqrt().

Here is the call graph for this function:

double bn_flt_min ( void  )

Definition at line 115 of file ulp.c.

Referenced by bn_flt_max(), and bn_flt_min_sqrt().

double bn_flt_max ( void  )

Definition at line 123 of file ulp.c.

References bn_flt_min().

Referenced by bn_flt_max_sqrt().

Here is the call graph for this function:

double bn_flt_min_sqrt ( void  )

Definition at line 138 of file ulp.c.

References bn_flt_min().

Here is the call graph for this function:

double bn_flt_max_sqrt ( void  )

Definition at line 145 of file ulp.c.

References bn_flt_max().

Here is the call graph for this function:

double bn_dbl_min_sqrt ( void  )

Definition at line 152 of file ulp.c.

References bn_dbl_min().

Here is the call graph for this function:

double bn_dbl_max_sqrt ( void  )

Definition at line 159 of file ulp.c.

References bn_dbl_max().

Here is the call graph for this function:

double bn_ulp ( double  val)

Definition at line 166 of file ulp.c.