Did I find the right examples for you? yes no

All Samples(811)  |  Call(695)  |  Derive(116)  |  Import(0)
Second argument to a division or modulo operation was zero.

src/p/y/pyjs-HEAD/examples/libtest/GeneratorTest.py   pyjs(Download)
        def f():
            try:
                yield 1
                raise ZeroDivisionError('')
            except:
                try:
                    yield 3
                    raise ZeroDivisionError('')
                except:
                    yield 4
                raise ZeroDivisionError('')
                try:
                    yield 2
                    raise ZeroDivisionError()
                    #1/0
                    yield 3  # never get here

src/g/f/gf-0.1.4/examples/rational.py   gf(Download)
    """
    if denominator == 0:
        raise ZeroDivisionError("Denominator can not be zero")
    if cancel:
        g = gcd( numerator, denominator )

src/w/e/Webapp2-Sample-Applications-HEAD/sample-app-auth/ndb/tasklets_test.py   Webapp2-Sample-Applications(Download)
    mf.putq(4)
    self.ev.run()
    mf.set_exception(ZeroDivisionError())
    f3.set_result(3)
    self.ev.run()
    f2.set_result(2)
    mf.putq(f1)
    f1.set_exception(ZeroDivisionError())
    mf.putq(f2)
    mf.putq(f3)
    self.ev.run()
    f3 = tasklets.Future()
    f3.set_exception(ZeroDivisionError())
    qf.putq(f3)
    self.ev.run()
    self.ev.run()
    f4 = tasklets.Future()
    f4.set_exception(ZeroDivisionError())
    self.ev.run()
    qf.putq(f4)
    sqf.putq(f1)
    sqf.complete()
    f1.set_exception(ZeroDivisionError())
    self.assertRaises(ZeroDivisionError, g1.get_result)
 

src/p/y/Pymol-script-repo-HEAD/modules/ADT/PyBabel/util.py   Pymol-script-repo(Download)
    dist = distance(a,b) * distance(b,c)
    if dist == 0: # SD 2010 - http://mgl.scripps.edu/forum/viewtopic.php?f=11&t=245&p=1882
        raise ZeroDivisionError("Input used:", a, b, c)
 
    cos_theta = ( (a[0] - b[0]) * (c[0] - b[0]) +

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/raisingops/raisingops.py   plexnet(Download)
        return llop.int_floordiv(Signed, x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def uint_floordiv_zer(x, y):
        return x / y
    else:
        raise ZeroDivisionError("unsigned integer division")
 
def llong_floordiv_zer(x, y):
        return llop.llong_floordiv(SignedLongLong, x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def ullong_floordiv_zer(x, y):
        return llop.llong_floordiv(UnsignedLongLong, x, y)
    else:
        raise ZeroDivisionError("unsigned integer division")
 
 
        return int_floordiv_ovf(x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def int_mod_ovf(x, y):

src/s/a/sage-HEAD/src/sage/schemes/elliptic_curves/ell_point.py   sage(Download)
                    N1 = N.gcd(Integer(2*y1 + a1*x1 + a3))
                    N2 = N//N1
                    raise ZeroDivisionError("Inverse of %s does not exist (characteristic = %s = %s*%s)" % (2*y1 + a1*x1 + a3, N, N1, N2))
                else:
                    raise ZeroDivisionError("Inverse of %s does not exist" % (2*y1 + a1*x1 + a3))
                    N1 = N.gcd(Integer(x1-x2))
                    N2 = N//N1
                    raise ZeroDivisionError("Inverse of %s does not exist (characteristic = %s = %s*%s)" % (x1-x2, N, N1, N2))
                else:
                    raise ZeroDivisionError("Inverse of %s does not exist" % (x1-x2))

src/s/y/Sypy-HEAD/rpython/raisingops/raisingops.py   Sypy(Download)
        return llop.int_floordiv(Signed, x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def uint_floordiv_zer(x, y):
        return x / y
    else:
        raise ZeroDivisionError("unsigned integer division")
 
def llong_floordiv_zer(x, y):
        return llop.llong_floordiv(SignedLongLong, x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def ullong_floordiv_zer(x, y):
        return llop.llong_floordiv(UnsignedLongLong, x, y)
    else:
        raise ZeroDivisionError("unsigned integer division")
 
 
        return int_floordiv_ovf(x, y)
    else:
        raise ZeroDivisionError("integer division")
 
def int_mod_ovf(x, y):

src/b/l/BlueCop-XBMC-Plugins-HEAD/plugin.video.free.cable/resources/lib/demjson.py   BlueCop-XBMC-Plugins(Download)
                    def __div__(self,x):
                        if x == 0:
                            raise ZeroDivisionError('float division')
                        elif x < 0:
                            return neginf
                    def __divmod__(self,x):
                        if x == 0:
                            raise ZeroDivisionError('float divmod()')
                        elif x < 0:
                            return (nan,nan)
                    def __mod__(self,x):
                        if x == 0:
                            raise ZeroDivisionError('float modulo')
                        else:
                            return nan
                    def __div__(self,x):
                        if x == 0:
                            raise ZeroDivisionError('float division')
                        elif x < 0:
                            return inf
                    def __divmod__(self,x):
                        if x == 0:
                            raise ZeroDivisionError('float divmod()')
                        elif x < 0:
                            return (nan,nan)

src/g/m/gmpy_cffi-0.1/gmpy_cffi/mpz.py   gmpy_cffi(Download)
    def __floordiv__(self, other):
        if isinstance(other, (int, long)):
            if other == 0:
                raise ZeroDivisionError('mpz division by zero')
            res = _new_mpz()
        elif isinstance(other, mpz):
            if other == 0:
                raise ZeroDivisionError('mpz division by zero')
            res = _new_mpz()
            gmp.mpz_fdiv_q(res, self._mpz, other._mpz)
    def __rfloordiv__(self, other):
        if isinstance(other, (int, long)):
            if self == 0:
                raise ZeroDivisionError('mpz division by zero')
            res = _new_mpz()
    def __mod__(self, other):
        if isinstance(other, (int, long)):
            if other == 0:
                raise ZeroDivisionError('mpz modulo by zero')
            r = _new_mpz()
        elif isinstance(other, mpz):
            if other == 0:
                raise ZeroDivisionError('mpz modulo by zero')
            r = _new_mpz()
            gmp.mpz_fdiv_r(r, self._mpz, other._mpz)

src/m/i/mibian-0.1.2/mibian/__init__.py   mibian(Download)
			put = max(0.0, self.strikePrice - self.underlyingPrice)
		if self.strikePrice == 0:
			raise ZeroDivisionError('The strike price cannot be zero')
		else:
			call = e**(-self.foreignRate * self.daysToExpiration) * \
			put = -1.0 if self.underlyingPrice < self.strikePrice else 0.0
		if self.strikePrice == 0:
			raise ZeroDivisionError('The strike price cannot be zero')
		else:
			_b_ = e**-(self.foreignRate * self.daysToExpiration)
			put = 1.0 if self.underlyingPrice < self.strikePrice else 0.0
		if self.strikePrice == 0:
			raise ZeroDivisionError('The strike price cannot be zero')
		else:
			_b_ = e**-(self.domesticRate * self.daysToExpiration)
			return 0.0
		if self.strikePrice == 0:
			raise ZeroDivisionError('The strike price cannot be zero')
		else:
			return self.underlyingPrice * e**-(self.foreignRate * \
			put = max(0.0, self.strikePrice - self.underlyingPrice)
		if self.strikePrice == 0:
			raise ZeroDivisionError('The strike price cannot be zero')
		else:
			call = self.underlyingPrice * norm.cdf(self._d1_) - \

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next