News for hackers. Stuff that matters.
Re:One does not simply calculate the absolute value by jrochkind1 on Sunday August 22, 2021 @08:47PM (#28271189)
You can of course have some idea how floating point numbers work, but still not know how to bit twiddle abs().

I don't know what to take from the fact that Java stdlib didn't use it until Java 18? It does seem like it wasn't obvious to at least someone who knew something.

> If a similar article were written about how shifting an integer to the right by one bit is equivalent to dividing it by two, I highly suspect it would attract no attention on this site,

Nah, it would be full of comments of people saying "well of course I knew that! doesn't everyone who's anyone? I can't believe how many newbies don't though!" :)

There are no comments on this comment yet.