IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2008, 6:24:28 PM (18 years ago)
Author:
eugene
Message:

fixes for interger-type vectors; finish imextract upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/stack_math.c

    r20856 r20873  
    819819    }                                           \
    820820    if ((FTYPE == 's') && (V1->type == 's')) {  \
    821       opihi_int M1  = V1[0].FltValue;           \
     821      opihi_int M1  = V1[0].IntValue;           \
    822822      OUT[0].type = 's';                        \
    823823      OUT[0].IntValue = OP;                     \
     
    855855  if (!strcmp (op, "rnd"))    S_FUNC(M1*0.0 + drand48(), 'S');
    856856  if (!strcmp (op, "not"))    S_FUNC(!(M1), 's');
    857   if (!strcmp (op, "--"))     S_FUNC(-(M1), 's');
     857  if (!strcmp (op, "--"))     S_FUNC(-1*M1, 's'); // NOTE: opihi_int is signed,
    858858  if (!strcmp (op, "isinf"))  S_FUNC(!finite(M1), 'S'); // XXX modify in future
    859859  if (!strcmp (op, "isnan"))  S_FUNC(isnan(M1), 'S'); // XXX modify in future   
     
    939939  if (!strcmp (op, "zero"))   V_FUNC(0, 's');
    940940  if (!strcmp (op, "not"))    V_FUNC(!(*M1), 's');
    941   if (!strcmp (op, "--"))     V_FUNC(-(*M1), 's');
     941  if (!strcmp (op, "--"))     V_FUNC(-1*(*M1), 's'); // NOTE: opihi_int is signed
    942942  if (!strcmp (op, "isinf"))  V_FUNC(!finite(*M1), 'S');
    943943  if (!strcmp (op, "isnan"))  V_FUNC(isnan(*M1), 'S');
     
    980980  if (!strcmp (op, "="))     { }
    981981  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1);         }}
    982   if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (float)(int)(*M1); }}
     982  if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(int)(*M1); }}
    983983  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1);          }}
    984984  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
Note: See TracChangeset for help on using the changeset viewer.