コード例 #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))