! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test math.bits sequences arrays ;
+USING: tools.test math math.bits sequences arrays ;
IN: math.bits.tests
[ t ] [ BIN: 111111 3 <bits> second ] unit-test
[ 2 ] [ -3 make-bits length ] unit-test
[ 1 ] [ 1 make-bits length ] unit-test
[ 1 ] [ -1 make-bits length ] unit-test
+
+! Odd bug
+[ t ] [
+ 1067811677921310779 make-bits
+ 1067811677921310779 >bignum make-bits
+ sequence=
+] unit-test
+
+[ t ] [
+ 1067811677921310779 make-bits peek
+] unit-test
+
+[ t ] [
+ 1067811677921310779 >bignum make-bits peek
+] unit-test
\ No newline at end of file
[ 6 59967 ] [ 3837888 factor-2s ] unit-test
[ 6 -59967 ] [ -3837888 factor-2s ] unit-test
+
+[ 1 ] [
+ 183009416410801897
+ 1067811677921310779
+ 2135623355842621559
+ ^mod
+] unit-test
+
+[ 1 ] [
+ 183009416410801897
+ 1067811677921310779
+ 2135623355842621559
+ [ >bignum ] tri@ ^mod
+] unit-test
\ No newline at end of file
[ f ] [ 36 miller-rabin ] unit-test
[ t ] [ 37 miller-rabin ] unit-test
[ 101 ] [ 100 next-prime ] unit-test
-[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test
+[ t ] [ 2135623355842621559 miller-rabin ] unit-test
+[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test
\ No newline at end of file
[ f ] [ BIN: -1101 >bignum 3 bit? ] unit-test
[ t ] [ BIN: -1101 >bignum 4 bit? ] unit-test
+[ t ] [ 1067811677921310779 >bignum 59 bit? ] unit-test
+
[ 2 ] [ 0 next-power-of-2 ] unit-test
[ 2 ] [ 1 next-power-of-2 ] unit-test
[ 2 ] [ 2 next-power-of-2 ] unit-test