From 1f63bc6389dd51b6ee93c1e2900f77dfe606f1af Mon Sep 17 00:00:00 2001 From: eficas <> Date: Mon, 27 Feb 2006 18:22:31 +0000 Subject: [PATCH] ajout sqrt pour parametres --- Extensions/param2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Extensions/param2.py b/Extensions/param2.py index 2ccdac4b..b8c56998 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -65,6 +65,7 @@ class Binop(Formula): def __adapt__(self,validator): return validator(self.eval()) +original_sqrt=math.sqrt original_cos=math.cos original_sin=math.sin original_ncos=Numeric.cos @@ -72,6 +73,7 @@ original_nsin=Numeric.sin class Unop(Formula): opmap = { '-': lambda x: -x, + 'sqrt': lambda x: original_sqrt(x), 'sin': lambda x: original_sin(x), 'cos': lambda x: original_cos(x) , 'ncos': lambda x: original_ncos(x), @@ -135,7 +137,9 @@ def cos(f): return Unop('ncos', f) def sin(f): return Unop('nsin', f) Numeric.cos=cos Numeric.sin=sin +def sqrt(f): return Unop('sqrt', f) def cos(f): return Unop('cos', f) def sin(f): return Unop('sin', f) math.cos=cos math.sin=sin +math.sqrt=sqrt -- 2.39.2