Hacker News new | past | comments | ask | show | jobs | submit login

Ah, that's a missing link I hadn't thought of.

This was a result of converting degrees to radians. There is another way as well.

    from math import sin, acos

    def nines(repeat: int) -> float:
          repeated = 2 / int('9' * repeat)
          value = sin(repeated) * acos(repeated) * (10 ** repeat)
          return value

      nines(18)
I'm sure this can be edited to accept other values in the same way.

Took a while to convince me, but you got there.




Hint: it works just as well if you replace the acos argument with 0

    value = sin(repeated) * acos(0) * (10 ** repeat)
(keep in mind that that acos(0) = pi/2)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: