The native C++ < and > operators won't handle this correctly, so the result was different depending on the order of arguments. This is now fixed by explicitly checking for positive and negative zero values. Fixes #6589.
Patch from Anonymous