Double当然是不精确的.需要用CompareValue<br>Returns the relationship between two numeric values.<br><br>Unit<br><br>Math<br><br>Category<br><br>Comparison routines<br><br>Delphi syntax:<br><br>function CompareValue(const A, B: Integer): TValueRelationship; overload;<br>function CompareValue(const A, B: Int64): TValueRelationship; overload;<br>function CompareValue(const A, B: Single; Epsilon: Single = 0): TValueRelationship; overload;<br>function CompareValue(const A, B: Double; Epsilon: Double = 0): TValueRelationship; overload;<br>function CompareValue(const A, B: Extended; Epsilon: Extended = 0): TValueRelationship; overload;<br><br>C++ syntax:<br><br>extern PACKAGE TValueRelationship __fastcall CompareValue(const int A, const int B);<br>extern PACKAGE TValueRelationship __fastcall CompareValue(const __int64 A, const __int64 B);<br>extern PACKAGE TValueRelationship __fastcall CompareValue(const float A, const float B, float Epsilon = 0);<br>extern PACKAGE TValueRelationship __fastcall CompareValue(const double A, const double B, <br>double Epsilon = 0);<br><br>extern PACKAGE TValueRelationship __fastcall CompareValue(const Extended A, const Extended<br> B, Extended Epsilon =0);<br><br>Description<br><br>Call CompareValue to determine the relationship between two numeric values. When comparing floating-point values, CompareValue lets you specify a maximum difference to use when comparing values, so that they are considered the same if they are within that amount.<br><br>A and B are the values to compare.<br><br>Epsilon is the maximum amount by which A and B can differ and still be considered the same value.<br><br>CompareValue returns <br><br>LessThanValue if A is less than B (by more than Epsilon if A and B are floating-point numbers).<br> EqualsValue if A is equivalent to B (the same, or within Epsilon if A and B are floating-point numbers).<br> GreaterThanValue if A is larger than B (by more than Epsilon if A and B are floating-point numbers).