Skip to main content
Commonmark migration
Source Link

JavaScript (Node.js),  105  101 bytes

Shorter Node version suggested by @Neil
Saved 4 more bytes thanks to @ShieruAsakoto

Takes input as (x)(y).

x=>y=>(v=Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

JavaScript (Node.js),  105  101 bytes

Shorter Node version suggested by @Neil
Saved 4 more bytes thanks to @ShieruAsakoto

Takes input as (x)(y).

x=>y=>(v=Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

JavaScript (Node.js),  105  101 bytes

Shorter Node version suggested by @Neil
Saved 4 more bytes thanks to @ShieruAsakoto

Takes input as (x)(y).

x=>y=>(v=Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

saved 4 bytes
Source Link
Arnauld
  • 197.8k
  • 20
  • 179
  • 650

JavaScript (Node.js), 105 105  101 bytes

Shorter Node version suggested by @Neil
Saved 4 more bytes thanks to @ShieruAsakoto

Takes input as (x)(y).

x=>y=>(v=new Bufferv=Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

JavaScript (Node.js), 105 bytes

Shorter Node version suggested by @Neil

Takes input as (x)(y).

x=>y=>(v=new Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

JavaScript (Node.js),  105  101 bytes

Shorter Node version suggested by @Neil
Saved 4 more bytes thanks to @ShieruAsakoto

Takes input as (x)(y).

x=>y=>(v=Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

added a shorter version
Source Link
Arnauld
  • 197.8k
  • 20
  • 179
  • 650

JavaScript (Node.js), 105 bytes

Shorter Node version suggested by @Neil

Takes input as (x)(y).

x=>y=>(v=new Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!Try it online!

#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

JavaScript (Node.js), 105 bytes

Shorter Node version suggested by @Neil

Takes input as (x)(y).

x=>y=>(v=new Buffer(4),v.writeInt32LE((g=n=>v.writeFloatLE(n)&&v.readInt32LE())(x)^g(y)),v.readFloatLE())

Try it online!


#JavaScript (ES6), 115 bytes

Takes input as an array of 2 floats.

a=>(v=new DataView(new ArrayBuffer(4))).getFloat32(v.setUint32([x,y]=a.map(n=>v.getUint32(v.setFloat32(0,n))),x^y))

Try it online!

silly typo
Source Link
Arnauld
  • 197.8k
  • 20
  • 179
  • 650
Loading
Source Link
Arnauld
  • 197.8k
  • 20
  • 179
  • 650
Loading