|
From: <ho...@us...> - 2004-02-04 02:56:50
|
Update of /cvsroot/ganc/ganc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv876/src Modified Files: evaluate.c parser_stuff.c syntax.y Log Message: Added 3 new functions: INT, FLOOR, CEIL Index: evaluate.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/evaluate.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** evaluate.c 20 Jan 2004 01:33:40 -0000 1.9 --- evaluate.c 4 Feb 2004 02:54:25 -0000 1.10 *************** *** 81,84 **** --- 81,93 ---- else result= sqrtl (arg); } + if (id==FUN_INT) { + result= nearbyintl (arg); + } + if (id==FUN_FLOOR) { + result= floorl (arg); + } + if (id==FUN_CEIL) { + result= ceill (arg); + } CheckNumber (result); Index: parser_stuff.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/parser_stuff.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** parser_stuff.c 4 Feb 2004 01:06:38 -0000 1.15 --- parser_stuff.c 4 Feb 2004 02:54:32 -0000 1.16 *************** *** 73,77 **** "exp10", //15 "log", ! "sqrt", //17 "" }; --- 73,80 ---- "exp10", //15 "log", ! "sqrt", ! "int", ! "floor", ! "ceil", //20 "" }; Index: syntax.y =================================================================== RCS file: /cvsroot/ganc/ganc/src/syntax.y,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** syntax.y 4 Feb 2004 01:06:38 -0000 1.7 --- syntax.y 4 Feb 2004 02:54:32 -0000 1.8 *************** *** 12,16 **** } ! %token <name> ENTRY %token <id> FUNCTION %token <name> VARIABLE --- 12,16 ---- } ! %token <name> ENTRY %token <id> FUNCTION %token <name> VARIABLE *************** *** 88,91 **** --- 88,92 ---- format_token: '_' exp { SetResultOutputFormat (OUTPUT_FORMAT_BASE, $2); } | '_' { SetResultOutputFormat (OUTPUT_FORMAT_PRINTBASE, 1); } + /* | ENTRY { printf ("format entry: %s\n", $1); } */ ; |