Commit 1c69482b authored by sumpfralle's avatar sumpfralle

don't break if "decimal" is not available


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@763 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 3b942f09
...@@ -22,7 +22,6 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>. ...@@ -22,7 +22,6 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
from pycam.Geometry.utils import epsilon, sqrt, number from pycam.Geometry.utils import epsilon, sqrt, number
from decimal import Decimal
def _is_near(x, y): def _is_near(x, y):
return abs(x - y) < epsilon return abs(x - y) < epsilon
......
...@@ -20,15 +20,22 @@ You should have received a copy of the GNU General Public License ...@@ -20,15 +20,22 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
import decimal # use the "decimal" module for fixed precision numbers (only for debugging)
_use_precision = False
# "decimal" is not available in some minimal installations of python2.6
# (e.g. in Debian Lenny)
try:
import decimal
except ImportError:
_use_precision = False
import math import math
INFINITE = 100000 INFINITE = 100000
epsilon = 0.00001 epsilon = 0.00001
# use the "decimal" module for fixed precision numbers (only for debugging)
_use_precision = False
# the lambda functions below are more efficient than function definitions # the lambda functions below are more efficient than function definitions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment