|
From: <ho...@us...> - 2004-02-27 03:13:15
|
Update of /cvsroot/ganc/ganc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7355/src Modified Files: display.c display_text.c evaluate.c Log Message: Check for ISNAN and ISINF to improve portability So far if they're not available no alternative is used Index: display.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/display.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** display.c 27 Feb 2004 00:34:07 -0000 1.3 --- display.c 27 Feb 2004 03:04:52 -0000 1.4 *************** *** 199,203 **** if (base==10) { // base 10 -> EASY output_text= (char *) malloc (50 + extra_size); ! sprintf (output_text, "%15.10Lg\n", ResultValue ()); } else { // other base result= ResultValue (); --- 199,203 ---- if (base==10) { // base 10 -> EASY output_text= (char *) malloc (50 + extra_size); ! sprintf (output_text, FORMAT_STRING, ResultValue ()); } else { // other base result= ResultValue (); Index: display_text.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/display_text.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** display_text.c 27 Feb 2004 02:44:28 -0000 1.2 --- display_text.c 27 Feb 2004 03:04:52 -0000 1.3 *************** *** 70,73 **** --- 70,76 ---- output_text= (char *) malloc (50 + extra_size); sprintf (output_text, FORMAT_STRING, ResultValue ()); + i= 0; + while (output_text[i]==' ') ++i; + strcpy (output_text, output_text + i); } else { // other base result= ResultValue (); Index: evaluate.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/evaluate.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** evaluate.c 27 Feb 2004 02:44:28 -0000 1.11 --- evaluate.c 27 Feb 2004 03:04:52 -0000 1.12 *************** *** 231,235 **** { if (ISINF ((double) value)) NotifyError (PERROR_OVERFLOW, NULL); ! if (isnan ((double) value)) NotifyError (PERROR_NAN, NULL); } --- 231,235 ---- { if (ISINF ((double) value)) NotifyError (PERROR_OVERFLOW, NULL); ! if (ISNAN ((double) value)) NotifyError (PERROR_NAN, NULL); } |