Returns the i-bit value of self

assert 10.getbit(0) == 0
 assert 10.getbit(3) == 1

Property definitions

core :: bitset $ Int :: getbit
	# Returns the i-bit value of `self`
	#
	#	 assert 10.getbit(0) == 0
	#	 assert 10.getbit(3) == 1
	fun getbit(index: Int): Int `{
		assert(index >= 0 && index < 32);

		int op = 1 << index;

		if((self & op) == 0)
			return 0;
		else
			return 1;
	`}
lib/core/bitset.nit:44,2--57,3