all 6 comments

[–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (4 children)

\21. People who are afraid of longjmp() are pussies.

[–][deleted]  (3 children)

[deleted]

    [–][deleted] 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (2 children)

    It's just a variation on the old goto joke.

    [–]C3P0 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (1 child)

    Goto is my go-to for exiting nested loops.

    [–][deleted] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (0 children)

    Alright my friend, it's time we switch to beer.

    [–]C3P0 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

    Given that Pi can be estimated using the function 4 * (1 – 1/3 + 1/5 – 1/7 + …) with more terms giving greater accuracy, write a function that calculates Pi to an accuracy of 5 decimal places.

    And there you have encountered the biggest problem with that question. Unless you prove how and why that approximation works, the only way to know for certain that you’ve estimated to 5 digits is to compare it against a known value of Pi. That sort of defeats the point.

    Once the terms get smaller than 10-5 then the approximation must be accurate to 5 decimal places. No proof required.

    [–]fschmidt 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

    I agree with this post, which is shocking because I disagree with almost everything I read these days. What freak wrote this?