Esempio n. 1
0
def test_interval_symbolic():
    x = Symbol('x')
    e = Interval(0, 1)
    assert e.contains(x) == And(0 <= x, x <= 1)
    raises(TypeError, lambda: x in e)
    e = Interval(0, 1, True, True)
    assert e.contains(x) == And(0 < x, x < 1)
Esempio n. 2
0
def test_interval_symbolic():
    x = Symbol('x')
    e = Interval(0, 1)
    assert e.contains(x) == And(0 <= x, x <= 1)
    raises(TypeError, "x in e")
    e = Interval(0, 1, True, True)
    assert e.contains(x) == And(0 < x, x < 1)
Esempio n. 3
0
def test_interval_symbolic():
    x = Symbol('x')
    e = Interval(0, 1)
    assert e.contains(x) == And(S(0) <= x, x <= 1)
    raises(TypeError, lambda: x in e)
    e = Interval(0, 1, True, True)
    assert e.contains(x) == And(S(0) < x, x < 1)
Esempio n. 4
0
File: test.py Progetto: rrnntt/pyz
for a in f:
    print a, isinstance(a,String)
    
    
print hello + world
print hello + ' ' + Rational(3,4) 

t = Tuple(hello, f)
print t
print t[0]

Doubles = Interval(-1e300,1e300)
print Doubles
v = S(1e300)
print type(v),v,Doubles.contains(v)

print type(Doubles * Doubles)


x = Symbol('x', real = True, bounded = True)

print ( Interval(x+2,100) | Interval(x+3,100) ).contains(x+4.0) & (x < 90)
print Interval(x+4.0,100) & Interval(x+3,100)

print x.is_bounded

print Interval(sin(x),100)

print (x < 1) & (x > 0)