News for hackers. Stuff that matters.
Re:Why I often implement things from scratch (2006) by NohatCoder on Monday March 09, 2020 @02:52PM (#22528465)
>Not if they come in as integers that have to be coerced at some point.

In which case you can calculate the determinant exactly with your own roll, but a library will likely force you to convert everything to doubles.

>Compare ad to bc instead of ad - bc to zero, for one.

That is the same thing, a compare instruction is basically just a subtract that doesn't write the output, so you get zero/equality in exactly the same cases. Most compilers will probably turn your code into doing just one subtract and then check the flags, no matter which version you write.

There are no comments on this comment yet.