Update contrib.
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
27 int comparefloats(double symbian_op, double linux_op)
29 double fractpart1=0, intpart1=0, fractpart2=0, intpart2=0;
31 char str_int1[LEN+1] = "\0";
32 char str_fract1[LEN+1+2] = "\0";
33 char str_fract2[LEN+1+2] = "\0";
34 char format_str[10] = "\0";
35 int len1=0, len_to_comp=0;
37 if((symbian_op < 0) && (linux_op < 0))
39 symbian_op = symbian_op * -1;
40 linux_op = linux_op * -1;
43 fractpart1 = modf(symbian_op, &intpart1);
44 fractpart2 = modf(linux_op, &intpart2);
46 if(intpart1 == intpart2)
48 sprintf(str_int1, "%d", (int)intpart1);
49 len1 = strlen(str_int1);
51 len_to_comp = LEN - len1;
52 sprintf(format_str, "%s%d%s", "%0.", len_to_comp, "f");
54 sprintf(str_fract1, format_str, fractpart1);
55 sprintf(str_fract2, format_str, fractpart2);
57 if(strcmp(str_fract1, str_fract2) != 0)