Java xor xor(double lhs, double rhs)

Here you can find the source of xor(double lhs, double rhs)

Description

Check if exactly one of the two given values is not zero.

License

Open Source License

Parameter

Parameter Description
lhs The left value.
rhs The right value.

Return

True if both of the given values is not zero. False otherwise.

Declaration

public static boolean xor(double lhs, double rhs) 

Method Source Code

//package com.java2s;
/*// w  w  w.ja  v  a2 s.c  om
 * Copyright (c) 2015 Jakob Hende?
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE
 */

public class Main {
    /**
     * Check if exactly one of the two given values is not zero. This confirms to the implementation of XOR in
     * TI-Basic.
     *
     * @param lhs
     *         The left value.
     * @param rhs
     *         The right value.
     * @return True if both of the given values is not zero. False otherwise.
     */
    public static boolean xor(double lhs, double rhs) {
        return (lhs != 0 ^ rhs != 0);
    }
}

Related

  1. xor(byte[] op1, byte[] op2)
  2. xor(byte[] source, byte[] key)
  3. xor(byte[] x, byte[] y)
  4. xor(byte[]... bytesArr)
  5. xor(char[] a, char[] b)
  6. xor(final boolean value1, final boolean value2)
  7. xor(final boolean x, final boolean y)
  8. xor(final byte[] bytesA, final byte[] bytesB)
  9. xor(final byte[] hash, final byte[] input)