BRL-CAD
Loading...
Searching...
No Matches
Unit in the Last Place (ULP)

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

Collaboration diagram for Unit in the Last Place (ULP):

Files

file  ulp.h
 

Functions

double bn_ulp (double val)
 Calculate unit in the last place (ULP) for a given value.
 
float bn_ulpf (float val)
 same as bn_ulp() but for single precision floating point.
 

Machine epsilons, smallest step after 1.0 @ {

double bn_dbl_epsilon (void)
 
float bn_flt_epsilon (void)
 

Numeric positive normalized range limits @ {

double bn_dbl_min (void)
 
double bn_dbl_max (void)
 
float bn_flt_min (void)
 
float bn_flt_max (void)
 

Square-rooted limits @ {

float bn_flt_min_sqrt (void)
 
float bn_flt_max_sqrt (void)
 
double bn_dbl_min_sqrt (void)
 
double bn_dbl_max_sqrt (void)
 

Next possible value up/down from a given value @ {

double bn_nextafter_up (double val)
 
double bn_nextafter_dn (double val)
 
float bn_nextafterf_up (float val)
 
float bn_nextafterf_dn (float val)
 

Detailed Description

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

Function Documentation

◆ bn_dbl_epsilon()

double bn_dbl_epsilon ( void  )
extern

◆ bn_flt_epsilon()

float bn_flt_epsilon ( void  )
extern

◆ bn_dbl_min()

double bn_dbl_min ( void  )
extern

◆ bn_dbl_max()

double bn_dbl_max ( void  )
extern

◆ bn_flt_min()

float bn_flt_min ( void  )
extern

◆ bn_flt_max()

float bn_flt_max ( void  )
extern

◆ bn_flt_min_sqrt()

float bn_flt_min_sqrt ( void  )
extern

◆ bn_flt_max_sqrt()

float bn_flt_max_sqrt ( void  )
extern

◆ bn_dbl_min_sqrt()

double bn_dbl_min_sqrt ( void  )
extern

◆ bn_dbl_max_sqrt()

double bn_dbl_max_sqrt ( void  )
extern

◆ bn_nextafter_up()

double bn_nextafter_up ( double  val)
extern

◆ bn_nextafter_dn()

double bn_nextafter_dn ( double  val)
extern

◆ bn_nextafterf_up()

float bn_nextafterf_up ( float  val)
extern

◆ bn_nextafterf_dn()

float bn_nextafterf_dn ( float  val)
extern

◆ bn_ulp()

double bn_ulp ( double  val)
extern

Calculate unit in the last place (ULP) for a given value.

If provided value is positive, it's the positive distance to the next double. If provided value is negative, it's the negative distance to the next negative double.

Parameters
valthe input double value.
Returns
distance to the next representable double precision value

◆ bn_ulpf()

float bn_ulpf ( float  val)
extern

same as bn_ulp() but for single precision floating point.