<commit_before>package ca.six.jold.bits;

class Bit01 {
	public static void main(String[] args) {

	}

	public static void isOdd(int n){
		// 判断奇偶
		if(n % 2 == 0) {/*奇数*/}

		int after = n & 1; //1其实是000..01, 所以after值就是只有n的最后一位留了下来
		if(after == 1) {/*奇数*/}

	}
}<commit_msg>java bit xor<commit_after>package ca.six.jold.bits;

class Bit01 {
	public static void main(String[] args) {
		swap1(3, 7);
		swap2(9, 4);
	}

	public static void isOdd(int n) {
		// 判断奇偶
		if (n % 2 == 0) {/*奇数*/}

		int after = n & 1; //1其实是000..01, 所以after值就是只有n的最后一位留了下来
		if (after == 1) {/*奇数*/}
	}

	// 要求不借用额外空间
	public static void swap1(int x, int y) {
		x = x - y; //10, 4 -> 6, 4
		y = x + y; //=> 6, 10
		x = y - x; //=> 4, 10
		System.out.println("swap01 : x = " + x + " ; y = " + y);
	}

	// 要求不借用额外空间 (异或, xor, ^ : 相同为0, 不同为1)
	public static void swap2(int x, int y) {
		x = x ^ y;
		y = x ^ y;
		x = x ^ y;
		System.out.println("swap02 : x = " + x + " ; y = " + y);
	}
}
{'fraction_non_alphanumeric': 0.20270270270270271, 'fraction_numerical': 0.05093555093555094, 'mean_word_length': 2.34375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4227389', 'n_tokens_mistral': 544, 'n_tokens_neox': 501, 'n_words': 120}