pydsm.relab.eps

pydsm.relab.eps(x=1.0)

Provide floating point relative accuracy

This function tries to replicate the eps interface of Matlab.

Parameters:

x : float or array_like or numeric type

Returns:

d : float or array_like

If x is a float, the positive distance from abs(x) to the next larger in magnitude floating point number of the same precision as x.

If x is an array, operation is elementwise.

If x is a numeric type, operation is for 1.0 in that numeric type.

Examples

>>> eps()
2.2204460492503131e-16
>>> eps(1/2)
1.1102230246251565e-16
>>> eps(np.float32)
1.1920929e-07