Hacker News new | ask | show | jobs
by dataflow 40 days ago
> 1/2(-9.8) now equals -4.9 rather than -0.05102040816326530612

That should really be an error.

2 comments

Order of operations is clear. Division and multiplication have the same order and are evaluated left to right.

-4.9 is unequivocally correct.

Yes, thank you, I passed elementary school. Mathematical correctness is not the sole criterion that matters in this world.
Especially for a deterministic tool like this. Do what I say, not what I mean. I want no helpful cleverness that resulted in this bug in the first place.