From: Christian Caremoli <> Date: Thu, 15 Nov 2007 17:12:56 +0000 (+0000) Subject: CCAR: ajout __floordiv__ pour division entiere X-Git-Tag: V1_13b1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=526c01072793362a8e98073825d50085db31a684;p=modules%2Feficas.git CCAR: ajout __floordiv__ pour division entiere --- diff --git a/Extensions/param2.py b/Extensions/param2.py index 89f6464b..2546bc22 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -38,8 +38,11 @@ class Formula: def __mul__(self, other): return Binop('*', self, other) def __rmul__(self, other): return Binop('*', other, self) def __div__(self, other): return Binop('/', self, other) - def __truediv__(self, other): return Binop('/', self, other) def __rdiv__(self, other): return Binop('/', other, self) + def __truediv__(self, other): return Binop('/', self, other) + def __rtruediv__(self, other): return Binop('/', other, self) + def __floordiv__(self, other): return Binop('//', self, other) + def __rfloordiv__(self, other): return Binop('//', other, self) def __pow__(self, other): return Binop('**', self, other) def __rpow__(self, other): return Binop('**', other, self) def __getitem__(self,i):return Binop('[]',self,i) @@ -49,6 +52,7 @@ class Binop(Formula): '*': lambda a, b: a * b, '-': lambda a, b: a - b, '/': lambda a, b: a / b, + '//': lambda a, b: a // b, '**': lambda a, b: a ** b, '[]': lambda a, b: a[b] , }