58

Every programming language I know of does trigonometry in radians.

Yet I have been puzzled for 4 hours whether JS was broken because it kept saying Math.sin(30) != Math.sin(150), trying all kinds of values, looking up basic trigonometry stuff again and again.

After that, 10 minutes of wondering why my json was invalid... right, you can't comment things out.

Then 15 minutes being baffled by a simple script tag not working, because I wrote script href instead of script src.

Finally, I threw a liter of chocolate milk over a $400 keyboard.

I really need to stop setting up new projects at 3am.

Comments
  • 19
    You need to work on your chocolate milk consumption... At 3am? You're asking for an ulcer
  • 7
    @seraphimsystems Never doubt the chocolate milk! Joke aside, i think it's not such a bad alternative to coffee, at least talking about 3 am..
  • 6
    Could it be that you are comparing two floating point numbers?
    Normally you compare two floats by giving it a small range where you define they are equal.

    let a: number;
    let b: number;
    let ɛ: number = 0.00002; // ±range for comparison

    floateq(a, b, ɛ) {
    return b - ɛ <= a && a <= b + ɛ;
    }
  • 2
    @PonySlaystation Nah I know you can't plainly compare floats, this was a degrees vs radians problem.
  • 1
    @bittersweet Ahh now I get it 😁
  • 3
    CHOCOLATE MILK!!!!!
  • 2
    This made me feel better about trying to get Bazel to compile my app for 6 hours.
Add Comment