Changeset 1125


Ignore:
Timestamp:
Oct 1, 2007 12:58:47 PM (13 years ago)
Author:
forrest
Message:

union

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplex.cpp

    r1115 r1125  
    76007600static bool equalDouble(double value1, double value2)
    76017601{
    7602   unsigned int *i1 = (unsigned int *) &value1;
    7603   unsigned int *i2 = (unsigned int *) &value2;
    7604   if (sizeof(unsigned int)*2==sizeof(double))
    7605     return (i1[0]==i2[0]&&i1[1]==i2[1]);
     7602
     7603  union { double d; int i[2]; } v1,v2;
     7604  v1.d = value1;
     7605  v2.d = value2;
     7606  if (sizeof(int)*2==sizeof(double))
     7607    return (v1.i[0]==v2.i[0]&&v1.i[1]==v2.i[1]);
    76067608  else
    7607     return (i1[0]==i2[0]);
     7609    return (v1.i[0]==v2.i[0]);
    76087610}
    76097611int
Note: See TracChangeset for help on using the changeset viewer.