Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/Makefile	(revision 36398)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/Makefile	(revision 36399)
@@ -25,4 +25,5 @@
 $(SRC)/book.$(ARCH).o		\
 $(SRC)/book_commands.$(ARCH).o	\
+$(SRC)/cast.$(ARCH).o		\
 $(SRC)/center.$(ARCH).o	\
 $(SRC)/clear.$(ARCH).o		\
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/cast.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/cast.c	(revision 36399)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/cast.c	(revision 36399)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int cast (int argc, char **argv) {
+  
+  int  i, valid;
+  Vector *ivec, *ovec;
+
+  ivec = ovec = NULL;
+
+  if (argc < 6) goto usage;
+
+  valid = TRUE;
+  valid &= !strcmp(argv[2], "=");
+  valid &= !strcmp(argv[4], "as");
+  if (!valid) goto usage;
+
+  // out type 
+  char outType = OPIHI_NOTYPE;
+  if (!strcasecmp(argv[5], "int")) outType = OPIHI_INT;
+  if (!strcasecmp(argv[5], "float")) outType = OPIHI_FLT;
+  if (outType == OPIHI_NOTYPE) goto usage;
+
+  if ((ovec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto error;
+  if ((ivec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) goto error;
+
+  // ovec matches ivec in type
+  ResetVector (ovec, outType, ivec[0].Nelements);
+
+  // we have four cases: (ivec == flt or int) and (tvec == flt or int)
+  if ((ivec->type == OPIHI_FLT) && (ovec->type == OPIHI_FLT)) {
+    opihi_flt *vi = ivec[0].elements.Flt;
+    opihi_flt *vo = ovec[0].elements.Flt;
+    for (i = 0; i < ovec[0].Nelements; i++, vi++, vo++) {
+      *vo = *vi;
+    }
+    return (TRUE);
+  }
+  if ((ivec->type == OPIHI_FLT) && (ovec->type == OPIHI_INT)) {
+    opihi_flt *vi = ivec[0].elements.Flt;
+    opihi_int *vo = ovec[0].elements.Int;
+    for (i = 0; i < ovec[0].Nelements; i++, vi++, vo++) {
+      *vo = *vi;
+    }
+    return (TRUE);
+  }
+  if ((ivec->type == OPIHI_INT) && (ovec->type == OPIHI_FLT)) {
+    opihi_int *vi = ivec[0].elements.Int;
+    opihi_flt *vo = ovec[0].elements.Flt;
+    for (i = 0; i < ovec[0].Nelements; i++, vi++, vo++) {
+      *vo = *vi;
+    }
+    return (TRUE);
+  }
+  if ((ivec->type == OPIHI_INT) && (ovec->type == OPIHI_INT)) {
+    opihi_int *vi = ivec[0].elements.Int;
+    opihi_int *vo = ovec[0].elements.Int;
+    for (i = 0; i < ovec[0].Nelements; i++, vi++, vo++) {
+      *vo = *vi;
+    }
+    return (TRUE);
+  }
+
+error:
+  DeleteVector (ovec);
+  return (FALSE);
+
+usage:
+  gprint (GP_ERR, "SYNTAX: cast vec = vec as (int/float)\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/init.c	(revision 36398)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/init.c	(revision 36399)
@@ -10,4 +10,5 @@
 int center           PROTO((int, char **));
 int parity           PROTO((int, char **));
+int cast             PROTO((int, char **));
 int circstats        PROTO((int, char **));
 int clear            PROTO((int, char **));
@@ -164,4 +165,5 @@
   {1, "buffers",      list_buffers,     "list the currently allocated buffers (images)"},
   {1, "center",       center,           "center image on coords"},
+  {1, "cast",         cast,             "cast input vector to specified type"},
   {1, "circstats",    circstats,        "circular statistics"},
   {1, "clear",        clear,            "erase plot"},
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/convert_to_RPN.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/convert_to_RPN.c	(revision 36398)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/convert_to_RPN.c	(revision 36399)
@@ -30,4 +30,8 @@
     if (!strcmp (argv[i], "abs"))    { type = ST_UNARY; goto gotit; }
     if (!strcmp (argv[i], "int"))    { type = ST_UNARY; goto gotit; }
+    if (!strcmp (argv[i], "floor"))  { type = ST_UNARY; goto gotit; }
+    if (!strcmp (argv[i], "round"))  { type = ST_UNARY; goto gotit; }
+    if (!strcmp (argv[i], "ceil"))   { type = ST_UNARY; goto gotit; }
+    if (!strcmp (argv[i], "rint"))   { type = ST_UNARY; goto gotit; }
     if (!strcmp (argv[i], "exp"))    { type = ST_UNARY; goto gotit; }
     if (!strcmp (argv[i], "ten"))    { type = ST_UNARY; goto gotit; }
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/stack_math.c	(revision 36398)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/stack_math.c	(revision 36399)
@@ -1123,4 +1123,7 @@
   if (!strcmp (op, "abs"))    S_FUNC(fabs(M1), ST_SCALAR_INT);
   if (!strcmp (op, "int"))    S_FUNC((long long)(M1), ST_SCALAR_INT);
+  if (!strcmp (op, "floor"))  S_FUNC(floor (M1), ST_SCALAR_FLT);
+  if (!strcmp (op, "ceil"))   S_FUNC(ceil (M1), ST_SCALAR_FLT);
+  if (!strcmp (op, "rint"))   S_FUNC(nearbyint (M1), ST_SCALAR_FLT);
   if (!strcmp (op, "exp"))    S_FUNC(exp (M1), ST_SCALAR_FLT);
   if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1), ST_SCALAR_FLT);
@@ -1202,4 +1205,7 @@
   if (!strcmp (op, "abs"))    V_FUNC(fabs(*M1), ST_SCALAR_INT);
   if (!strcmp (op, "int"))    V_FUNC((long long)(*M1), ST_SCALAR_INT);
+  if (!strcmp (op, "floor"))  V_FUNC(floor (*M1), ST_SCALAR_FLT);
+  if (!strcmp (op, "ceil"))   V_FUNC(ceil (*M1), ST_SCALAR_FLT);
+  if (!strcmp (op, "rint"))   V_FUNC(nearbyint (*M1), ST_SCALAR_FLT);
   if (!strcmp (op, "exp"))    V_FUNC(exp(*M1), ST_SCALAR_FLT);
   if (!strcmp (op, "ten"))    V_FUNC(pow(10.0,*M1), ST_SCALAR_FLT);
@@ -1273,4 +1279,9 @@
   if (!strcmp (op, "abs"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1);         }}
   if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(long long)(*M1); }}
+
+  if (!strcmp (op, "floor")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = floor (*M1); }}
+  if (!strcmp (op, "ceil"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = ceil (*M1); }}
+  if (!strcmp (op, "rint"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = nearbyint (*M1); }}
+
   if (!strcmp (op, "exp"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1);          }}
   if (!strcmp (op, "ten"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
