Changeset 6250
- Timestamp:
- Jan 29, 2006, 9:59:45 AM (20 years ago)
- Location:
- trunk/Ohana/src/opihi/lib.shell
- Files:
-
- 3 edited
-
check_stack.c (modified) (2 diffs)
-
dvomath.c (modified) (2 diffs)
-
evaluate_stack.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/check_stack.c
r6249 r6250 14 14 stack[i].Float = strtod (stack[i].name, &c); 15 15 if (c == stack[i].name + strlen (stack[i].name)) { 16 # if (0)17 if (Nstack == 1) {18 stack[i].type = 'W';19 } else {20 stack[i].ptr = &(stack[i].Float);21 stack[i].type = 'S';22 }23 # endif24 16 stack[i].ptr = &(stack[i].Float); 25 17 stack[i].type = 'S'; … … 71 63 /* this is not a scalar, vector, or matrix. must be string */ 72 64 stack[i].type = 'W'; 73 74 /* let's not consider this an error75 sprintf (line, "unknown object %s", stack[i].name);76 push_error (line);77 return (-1);78 */79 65 } 80 66 } -
trunk/Ohana/src/opihi/lib.shell/dvomath.c
r4689 r6250 57 57 58 58 /* evaluate operations, free stack on error */ 59 Ncstack = Nstack; 59 60 if (!evaluate_stack (stack, &Nstack)) { 60 61 if (*size == 1) DeleteVector (vec); … … 65 66 switch (*size) { 66 67 case 0: 67 sprintf (outname, "%.12g", stack[0].Float); 68 if (Ncstack == 1) { 69 /* use exact input work */ 70 sprintf (outname, "%s", stack[0].name); 71 } else { 72 sprintf (outname, "%.12g", stack[0].Float); 73 } 68 74 break; 69 75 -
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
r4689 r6250 22 22 if (*Nstack == 1) { 23 23 if (stack[0].type == 'S') { 24 S_unary (&tmp_stack, &stack[0], "=");25 move_stack (&stack[0], &tmp_stack);26 24 return (TRUE); 27 25 } 28 26 if (stack[0].type == 'V') { 27 /* need to make a copy so we set output value? */ 29 28 V_unary (&tmp_stack, &stack[0], "="); 30 29 move_stack (&stack[0], &tmp_stack); … … 32 31 } 33 32 if (stack[0].type == 'M') { 33 /* need to make a copy so we set output value? */ 34 34 M_unary (&tmp_stack, &stack[0], "="); 35 35 move_stack (&stack[0], &tmp_stack);
Note:
See TracChangeset
for help on using the changeset viewer.
