Ejemplo n.º 1
0
...     def clamp(x):
...         if x & (sys.maxint+1L):
...             return int(x & sys.maxint) - sys.maxint - 1
...         else:
...             return int(x & sys.maxint)

                             ###################
                             ####   TEST1   ####
                             ###################

>>> print test1.f1(217)
1115467

>>> print test1.f2(0)
0

>>> print test1.f2(-192570368)
-385140736

>>> test1.f3([3,4,0,'testing',12.75,(5,3,1),0])
6
8
testingtesting
25.5
(5, 3, 1, 5, 3, 1)

>>> print g1(test1.f5)
[20, 14, 19, 9, 12, 25, 13, 9, 17, 23, 289, 26, 15, 13, 17, 19, 23, 18, 15, 14, 18, 22, 14, 18, 18, 17, 21, 27, 21, 20, 15, 12, 1745, 18, 17, 136, 25, 14, 27, 18, 92, 87, 386, 12, 52, 29, 63, 102, 49, 39, 26, 26, 18, 14, 16, 13, 22, 16, 29, 49, 24, 34, 30, 20, 16, 100, 98, 61, 20, 85, 61, 75, 54, 49, 19, 47, 32, 18, 67, 47, 86, 66, 184, 61, 42, 42, 74, 14, 26, 55, 74, 16, 37, 15, 19, 211, 17, 348, 369, 130, 12, 248, 264, 328, 162, 68, 69, 41, 128, 29, 240, 95, 244, 288, 673, 295, 108, 134, 380, 40, 42, 224, 137, 30, 15, 24, 11, 15, 6, 15, 19, 26, 19, 17, 15, 18, 16, 17, 11, 14, 11, 15, 11, 11, 19, 13, 18, 25, 14, 20, 12, 14, 8, 13, 17, 15, 16, 17, 15, 13, 12, 12, 10, 19, 15, 15, 16, 12, 24, 21, 14, 10, 19, 17, 14, 13, 20, 18, 11, 17, 21, 13, 21, 19, 17, 15, 19, 10, 17, 12, 16, 13, 16, 15, 13, 16, 16, 16, 15, 14, 11, 14, 18, 15, 25, 9, 19, 12, 13, 12, 18, 12, 13, 16, 13, 17, 18, 19, 16, 11, 18, 18, 27, 11, 22, 17, 13, 22, 20, 16, 9, 17, 14, 12, 20, 17, 15, 18, 16, 15, 15, 16, 16, 18, 18, 17, 21, 17, 12, 12, 17, 10, 20, 19, 18, 25]

>>> assert_true(PY21 or g1(test1.f4) == g1(test1.f5))
Ok

>>> print test1.f6(n=100, p=10001)
803

>>> test1.f7(-2-1j, 1+1j, 0.04+0.08j)
!!!!!!!""""""####################$$$$$$$$%%%&'*.)+ %$$$$$######""""""""""""
!!!!!!"""""####################$$$$$$$$%%%%&'(+2-)'&%%$$$$$######""""""""""
!!!!!""""###################$$$$$$$$$%%%&&'6E0~ 9=6(&%%%%$$$$######""""""""
!!!!"""###################$$$$$$$$%%&&&&''(+B     @('&&%%%%%$$#######""""""
!!!"""##################$$$$$$$%%&(,32)),5+,/M   E-,*+)''''-&$$#######"""""
!!!"#################$$$$$%%%%%&&&(,b~~/:             0,,:/;/&%$########"""
!!"###############$$$%%%%%%%%&&&&()+/?                     ='&%$$########""
!!"###########$$$%'&&&&%%%&&&&'')U ~                      G,('%%$$#######""
!"######$$$$$$%%&&*+)(((2*(''(()2p                         :@:'%$$########"
!###$$$$$$$$%%%%&'(*.IB24 0J,**+~                           -(&%$$$########
Ejemplo n.º 2
0
import test1
test1.f1()
Ejemplo n.º 3
0
from test1 import i
from test1 import x
from test1 import p1
from test1 import f1
from test1 import f2

print(i)
print(x)
print(p1)

f1()
f2()