News for hackers. Stuff that matters.
Re:Mean of two floating point numbers can be dangerous by ced on Sunday June 05, 2016 @09:30AM (#11840842)
... unless max is a huge positive integer, and min is a huge negative integer!
Re:Mean of two floating point numbers can be dangerous by RUBwkVjwLsDKgPw on Sunday June 05, 2016 @10:57AM (#11841264)
Just use signed ints. Signed integer underflow is undefined behavior so it can't happen /s
Re:Mean of two floating point numbers can be dangerous by gcc_programmer on Sunday June 05, 2016 @01:31PM (#11842031)
Lol'd . To the contrary, it _can_ happen, and when it does the behaviour is undefined for C/C++. However, rest assured - you are probably on a x86_64 machine programming in sth like Ruby or Java script, so your Apps should be alright :P