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 Revisions

2 of 3
added 3 characters in body
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, (削除) 32 (削除ここまで) 31 bytes

ḷ‘ɼ_’;N};1Ær1⁄2ßH}\/}x®$ÆiṪṪƊ?,ḟ0

Try it online!

A full program taking two arguments, b and a in that order. Implements @xnor’s algorithm, so be sure to upvote that one too! Uses recursion to find real roots to a quadratic equation of the form \$x^2 - w x + (y - w - 1) = 0\$ where \$w = \frac{a}{2 ^ n}\$ and \$y = b ^ \frac{1}{2n} \$ for some non-negative integer \$n\$.

Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

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