Package qubx :: Module ulp_diff
[hide private]
[frames] | no frames]

Module ulp_diff

source code

Functions [hide private]
 
c_mem_cast(x, f=None, t=None)
do a c-style memory cast
source code
 
ulp_diff_maker(converter, negative_zero)
Getting the ulp difference of floats and doubles is similar.
source code
 
dulpdiff(a, b)
Get the number of doubles between two doubles.
source code
 
fulpdiff(a, b) source code
 
ulpdiff(a, b)
Get the number of doubles between two doubles.
source code
Variables [hide private]
  dbl_to_lng = <functools.partial object>
  lng_to_dbl = <functools.partial object>
  flt_to_int = <functools.partial object>
  int_to_flt = <functools.partial object>
  __package__ = 'qubx'
Function Details [hide private]

c_mem_cast(x, f=None, t=None)

source code 

do a c-style memory cast

In Python...

x = 12.34 y = c_mem_cast(x, 'd', 'l')

... should be equivilent to the following in c...

double x = 12.34; long y = *(long*)&x;

ulp_diff_maker(converter, negative_zero)

source code 

Getting the ulp difference of floats and doubles is similar. Only difference if the offset and converter.