Skip to main content
updated based on suggestion from Unmitigated.
Source Link

Java (JDK), 109 7676 63 bytes

(a,b)->Float>b->a.intBitsToFloat(Floata.floatToIntBits(a)^Float^a.floatToIntBits(b)) 

Try it online!Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Thanks to Neil for a substantial savings on the byte count!

Thanks to Unmitigated for currying the way to another improvement!

Java (JDK), 109 76 bytes

(a,b)->Float.intBitsToFloat(Float.floatToIntBits(a)^Float.floatToIntBits(b)) 

Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Thanks to Neil for a substantial savings on the byte count!

Java (JDK), 109 76 63 bytes

a->b->a.intBitsToFloat(a.floatToIntBits(a)^a.floatToIntBits(b)) 

Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Thanks to Neil for a substantial savings on the byte count!

Thanks to Unmitigated for currying the way to another improvement!

moved declaration into header on tio, only the function itself is the solution now
Source Link

Java (JDK), 109109 76 bytes

 BiFunction<Float,Float,Float>g=(a,b)->Float.intBitsToFloat(Float.floatToIntBits(a)^Float.floatToIntBits(b))   

Try it online!Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Thanks to Neil for a substantial savings on the byte count!

Java (JDK), 109 bytes

 BiFunction<Float,Float,Float>g=(a,b)->Float.intBitsToFloat(Float.floatToIntBits(a)^Float.floatToIntBits(b))   

Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Java (JDK), 109 76 bytes

(a,b)->Float.intBitsToFloat(Float.floatToIntBits(a)^Float.floatToIntBits(b)) 

Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.

Thanks to Neil for a substantial savings on the byte count!

Source Link

Java (JDK), 109 bytes

 BiFunction<Float,Float,Float>g=(a,b)->Float.intBitsToFloat(Float.floatToIntBits(a)^Float.floatToIntBits(b)) 

Try it online!

Been a while since I golfed in Java and I'm not certain if I need the declaration on the LHS as part of the byte count? If it used DoubleBinaryOperator the LHS would be shorter, but the RHS would have to use Double.doubleToLongBits and Double.longBitsToDouble, so that's actually longer.