Dear experts, Is it possible to implement eps as a constant (similar to pi or e) representing the precision of the machine in scipy ? Any suggestion ? Nils
On Thu, 27 Nov 2003, Nils Wagner wrote:
Dear experts,
Is it possible to implement eps as a constant (similar to pi or e) representin the precision of the machine in scipy ?
No, because eps is not an universal constant (such as pi or e) but depends on the machine architecture. However, scipy provides (calculates) machine constants in scipy_base.machar module. For example (in ipython), In [1]: from scipy_base import machar_double In [2]: machar_double.eps Out[2]: 2.22044604925e-16 In [3]: machar_double.epsneg Out[3]: 1.11022302463e-16 In [4]: from scipy_base import machar_single In [5]: machar_single.eps Out[5]: 1.19209289551e-07 In [6]: machar_single.epsneg Out[6]: 5.96046447754e-08 For more information, see help(machar_double.__class__) HTH, Pearu
Pearu Peterson wrote:
On Thu, 27 Nov 2003, Nils Wagner wrote:
Dear experts,
Is it possible to implement eps as a constant (similar to pi or e) representin the precision of the machine in scipy ?
No, because eps is not an universal constant (such as pi or e) but depends on the machine architecture.
However, scipy provides (calculates) machine constants in scipy_base.machar module.
I think the limits module encapuslates the more basic machar module. You should probably import limits; e.g. from scipy_base import limits limits.double_epsilon limits.float_epsilon limits.double_tiny limits.float_tiny etc. -Travis O.
participants (3)
-
Nils Wagner -
Pearu Peterson -
Travis Oliphant