Here you can find the source of xor(boolean a[], boolean b[])
Parameter | Description |
---|---|
a | the first vector |
b | the second vector |
public static boolean[] xor(boolean a[], boolean b[])
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w. ja v a2 s . co m*/ * Computes vector whose elements are the results of logical XOR of the respective * elements in the two given vectors. * @param a the first vector * @param b the second vector * @return the vector containing logical XORs of the elements of the two given vectors */ public static boolean[] xor(boolean a[], boolean b[]) { boolean[] c = new boolean[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] ^ b[i]; } return c; } }