Fix two numerical issues in unit tests.
(transplanted from 7a558b6b9bf41f1497e97cd8f0b9d80855ee517f)

--HG--
branch : 3.1
extra : transplant_source : zU%8Bk%9B%F4%1F%14%97%E9%7C%D8%F0%B9%D8%08U%EEQ%7F