correct convertion from non decimal base
[calc.git] / argument.c
... / ...
CommitLineData
1#include <stdio.h>
2
3#include "parser.h"
4#include "tabular.h"
5
6#include "argument.h"
7
8/* global variables */
9
10tab_t *argument = NULL;
11
12/* argument management */
13
14/* get argument */
15
16double arg (int n)
17{
18 return get_tab (argument, n);
19}
20
21/* set arguments */
22
23tab_t *def (int nbops, element_t **ops)
24{
25 int i;
26 tab_t *new = alloc_tab (nbops);
27 for (i = 0; i < nbops; i++) {
28 double val = evaluate_element (ops[i], 0);
29 VERBOSE (DEBUG, fprintf (stdout, "value %d/%d = %g\n", i + 1, nbops, val));
30 set_tab (new, i + 1, val);
31 }
32 return new;
33}
34
35/* vim: set ts=4 sw=4 et: */