Home | History | Annotate | Download | only in test

Lines Matching refs:bit_length

878             k = x.bit_length()

886 # Alternative definition: x.bit_length() == 1 + floor(log_2(x))
895 self.assertEqual((0L).bit_length(), 0)
896 self.assertEqual((1L).bit_length(), 1)
897 self.assertEqual((-1L).bit_length(), 1)
898 self.assertEqual((2L).bit_length(), 2)
899 self.assertEqual((-2L).bit_length(), 2)
902 self.assertEqual((a-1).bit_length(), i)
903 self.assertEqual((1-a).bit_length(), i)
904 self.assertEqual((a).bit_length(), i+1)
905 self.assertEqual((-a).bit_length(), i+1)
906 self.assertEqual((a+1).bit_length(), i+1)
907 self.assertEqual((-a-1).bit_length(), i+1)