You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Klaus Ma (JIRA)" <ji...@apache.org> on 2015/11/24 06:41:11 UTC
[jira] [Commented] (MESOS-3552) CHECK failure due to floating point
precision on reservation request
[ https://issues.apache.org/jira/browse/MESOS-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15023808#comment-15023808 ]
Klaus Ma commented on MESOS-3552:
---------------------------------
Have a discussion with [~jieyu] at MESOS-1187, I think we'd better to introduce gtest's {{almostEqual()}} into our code to check double's equal. As a long term solution, fixed point will be the option.
> CHECK failure due to floating point precision on reservation request
> --------------------------------------------------------------------
>
> Key: MESOS-3552
> URL: https://issues.apache.org/jira/browse/MESOS-3552
> Project: Mesos
> Issue Type: Bug
> Components: master
> Reporter: Mandeep Chadha
> Assignee: Mandeep Chadha
>
> result.cpus() == cpus() check is failing due to ( double == double ) comparison problem.
> Root Cause :
> Framework requested 0.1 cpu reservation for the first task. So far so good. Next Reserve operation — lead to double operations resulting in following double values :
> results.cpus() : 23.9999999999999964472863211995 cpus() : 24
> And the check ( result.cpus() == cpus() ) failed.
> The double arithmetic operations caused results.cpus() value to be : 23.9999999999999964472863211995 and hence ( 23.9999999999999964472863211995 == 24 ) failed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)