Commits

Amaury Forgeot d'Arc committed 81d69df

Decimal.__trunc__

Comments (0)

Files changed (1)

pypy/module/_decimal/interp_decimal.py

         context = interp_context.getcontext(space)
         return self.to_long(space, context, rmpdec.MPD_ROUND_DOWN)
         
+    def descr_trunc(self, space):
+        context = interp_context.getcontext(space)
+        return self.to_long(space, context, rmpdec.MPD_ROUND_DOWN)
+        
     def descr_floor(self, space):
         context = interp_context.getcontext(space)
         return self.to_long(space, context, rmpdec.MPD_ROUND_FLOOR)
     __bool__ = interp2app(W_Decimal.descr_bool),
     __float__ = interp2app(W_Decimal.descr_float),
     __int__ = interp2app(W_Decimal.descr_int),
+    __trunc__ = interp2app(W_Decimal.descr_trunc),
     __floor__ = interp2app(W_Decimal.descr_floor),
     __ceil__ = interp2app(W_Decimal.descr_ceil),
     __round__ = interp2app(W_Decimal.descr_round),