IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6250


Ignore:
Timestamp:
Jan 29, 2006, 9:59:45 AM (20 years ago)
Author:
eugene
Message:

fixed evaluation of zero-padded ints

Location:
trunk/Ohana/src/opihi/lib.shell
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/check_stack.c

    r6249 r6250  
    1414      stack[i].Float = strtod (stack[i].name, &c);
    1515      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         # endif
    2416        stack[i].ptr   = &(stack[i].Float);
    2517        stack[i].type  = 'S';
     
    7163      /* this is not a scalar, vector, or matrix.  must be string */
    7264      stack[i].type  = 'W';
    73        
    74       /* let's not consider this an error
    75       sprintf (line, "unknown object %s", stack[i].name);
    76       push_error (line);
    77       return (-1);
    78       */
    7965    }
    8066  }
  • trunk/Ohana/src/opihi/lib.shell/dvomath.c

    r4689 r6250  
    5757
    5858  /* evaluate operations, free stack on error */
     59  Ncstack = Nstack;
    5960  if (!evaluate_stack (stack, &Nstack)) {
    6061    if (*size == 1) DeleteVector (vec);
     
    6566  switch (*size) {
    6667    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      }
    6874      break;
    6975
  • trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c

    r4689 r6250  
    2222  if (*Nstack == 1) {
    2323    if (stack[0].type == 'S') {
    24       S_unary (&tmp_stack, &stack[0], "=");
    25       move_stack (&stack[0], &tmp_stack);
    2624      return (TRUE);
    2725    }
    2826    if (stack[0].type == 'V') {
     27      /* need to make a copy so we set output value? */
    2928      V_unary (&tmp_stack, &stack[0], "=");
    3029      move_stack (&stack[0], &tmp_stack);
     
    3231    }
    3332    if (stack[0].type == 'M') {
     33      /* need to make a copy so we set output value? */
    3434      M_unary (&tmp_stack, &stack[0], "=");
    3535      move_stack (&stack[0], &tmp_stack);
Note: See TracChangeset for help on using the changeset viewer.