[ 
https://issues.apache.org/jira/browse/MESOS-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14734831#comment-14734831
 ] 

Klaus Ma commented on MESOS-1187:
---------------------------------

Have a sample as follow to show how to compare two double, I'm going to fix it 
for {{==/<=}} of Scalar. [~jieyu], [~bmahler], [~vinodkone], and comments for 
this?

{code}
  double r1 = 0.1 + 0.1 + 0.1 - 0.1 - 0.1;
  double r2 = 0.1;

  if (r1 == r2)
    cout << "it's equal" << endl;

  // Only this condition is true
  if (abs(r1 - r2) < numeric_limits<double>::epsilon()) 
    cout << "it's almost equal." << endl;

  // This condition will NOT trigger
  if (r1 <= r2 && r1 >= r2)
    cout << "it's equal too" << endl;
{code}

> precision errors with allocation calculations
> ---------------------------------------------
>
>                 Key: MESOS-1187
>                 URL: https://issues.apache.org/jira/browse/MESOS-1187
>             Project: Mesos
>          Issue Type: Bug
>          Components: allocation, master
>            Reporter: aniruddha sathaye
>
> As allocations are stored/transmitted as doubles many a times precision 
> errors creep in. 
> we have seen erroneous share calculations happen only because of floating 
> point arithmetic. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to