Ignore:
Timestamp:
Oct 24, 2006, 4:14:51 PM (19 years ago)
Author:
ole
Message:

Added function and test for calculating machine precision for Python Floats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/numerical_tools.py

    r3749 r3849  
    288288    return bins
    289289
    290 
     290def get_machine_precision():
     291    """Calculate the machine precision for Floats
     292    """
     293
     294    epsilon = 1.
     295    while epsilon/2 + 1. > 1.:
     296        epsilon /= 2
     297
     298    return epsilon   
    291299
    292300####################################################################
Note: See TracChangeset for help on using the changeset viewer.