예제 #1
0
 def test_fromdecimalstr(self):
     x = rbigint.fromdecimalstr("12345678901234567890523897987")
     assert x.tolong() == 12345678901234567890523897987L
     assert x.tobool() is True
     x = rbigint.fromdecimalstr("+12345678901234567890523897987")
     assert x.tolong() == 12345678901234567890523897987L
     assert x.tobool() is True
     x = rbigint.fromdecimalstr("-12345678901234567890523897987")
     assert x.tolong() == -12345678901234567890523897987L
     assert x.tobool() is True
     x = rbigint.fromdecimalstr("+0")
     assert x.tolong() == 0
     assert x.tobool() is False
     x = rbigint.fromdecimalstr("-0")
     assert x.tolong() == 0
     assert x.tobool() is False
예제 #2
0
 def fromdecimalstr(s):
     return W_LongObject(rbigint.fromdecimalstr(s))
예제 #3
0
 def fromdecimalstr(s):
     return W_LongObject(rbigint.fromdecimalstr(s))