Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

JavaScript (ES6), 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by performing bitwise or
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

JavaScript, 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by performing bitwise or
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

JavaScript (ES6), 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by performing bitwise or
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

deleted 2 characters in body
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 15
  • 40

JavaScript, 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by bitshifting answer by 0performing bitwise or
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

JavaScript, 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by bitshifting answer by 0
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

JavaScript, 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by performing bitwise or
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

deleted 38 characters in body
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 15
  • 40

JavaScript, 1817 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y>>0y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by bitshifting answer by 0
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online! Try it online!

JavaScript, 18 bytes

x=>y=>[x/y>>0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by bitshifting answer by 0
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

JavaScript, 17 bytes

Thanks to @Arnauld for golfing off one byte

x=>y=>[x/y|0,x%y]

Receives input in format (x)(y)

Gets floor of x/y by bitshifting answer by 0
Gets remainder by x%y
Puts both values in an array so that they can both be returned

Try it online!

added 178 characters in body
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 15
  • 40
Loading
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 15
  • 40
Loading

AltStyle によって変換されたページ (->オリジナル) /