2 * (C) Copyright 2014, Stephen M. Cameron.
4 * The license below covers all files distributed with fio unless otherwise
5 * noted in the file itself.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 extern int evaluate_arithmetic_expression(const char *buffer, long long *ival,
28 double *dval, double implied_units, int is_time);
30 int main(int argc, char *argv[])
38 if (fgets(buffer, 90, stdin) == NULL)
41 if (rc > 0 && buffer[rc - 1] == '\n')
42 buffer[rc - 1] = '\0';
43 rc = evaluate_arithmetic_expression(buffer, &result, &dresult, 1.0, 0);
45 printf("%lld (%20.20lf)\n", result, dresult);
47 fprintf(stderr, "Syntax error\n");