|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Provides functions to compare two TReal values. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "EPos_PosLmTrealCompare.h" |
|
22 |
|
23 // CONSTANTS |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // PosLmTrealCompare::IsEqual |
|
29 // |
|
30 // (other items were commented in a header). |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 EXPORT_C TBool PosLmTrealCompare::IsEqual( |
|
34 TReal32 aReal1, |
|
35 TReal32 aReal2) |
|
36 { |
|
37 return IsEqual(TRealX(aReal1), TRealX(aReal2)); |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // PosLmTrealCompare::IsEqual |
|
42 // |
|
43 // (other items were commented in a header). |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 EXPORT_C TBool PosLmTrealCompare::IsEqual( |
|
47 TReal64 aReal1, |
|
48 TReal64 aReal2) |
|
49 { |
|
50 return IsEqual(TRealX(aReal1), TRealX(aReal2)); |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // PosLmTrealCompare::IsEqual |
|
55 // |
|
56 // (other items were commented in a header). |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 EXPORT_C TBool PosLmTrealCompare::IsEqual( |
|
60 TRealX aReal1, |
|
61 TRealX aReal2) |
|
62 { |
|
63 return (aReal1.IsNaN() && aReal2.IsNaN()) || aReal1 == aReal2; |
|
64 } |
|
65 |
|
66 // End of File |