Mercurial > hg > octave-nkf
changeset 3327:bb81f9dcdac7
[project @ 1999-10-30 03:56:27 by jwe]
author | jwe |
---|---|
date | Sat, 30 Oct 1999 03:56:27 +0000 |
parents | c19f4b9484af |
children | c447b7fa53e8 |
files | examples/make_int.cc |
diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/make_int.cc +++ b/examples/make_int.cc @@ -140,6 +140,25 @@ octave_print_internal (os, scalar, pr_as_read_syntax); } +#ifdef DEFUNOP_OP +#undef DEFUNOP_OP +#endif + +#define DEFUNOP_OP(name, t, op) \ + UNOPDECL (name, a) \ + { \ + CAST_UNOP_ARG (const octave_ ## t&); \ + return octave_value (new octave_integer (op v.t ## _value ())); \ + } + +DEFUNOP_OP (not, integer, !) +DEFUNOP_OP (uminus, integer, -) +DEFUNOP_OP (transpose, integer, /* no-op */) +DEFUNOP_OP (hermitian, integer, /* no-op */) + +DEFNCUNOP_METHOD (incr, integer, increment) +DEFNCUNOP_METHOD (decr, integer, decrement) + #ifdef DEFBINOP_OP #undef DEFBINOP_OP #endif @@ -245,6 +264,14 @@ cerr << "installing integer type at type-id = " << octave_integer::static_type_id () << "\n"; + INSTALL_UNOP (not, octave_integer, not); + INSTALL_UNOP (uminus, octave_integer, uminus); + INSTALL_UNOP (transpose, octave_integer, transpose); + INSTALL_UNOP (hermitian, octave_integer, hermitian); + + INSTALL_NCUNOP (incr, octave_integer, incr); + INSTALL_NCUNOP (decr, octave_integer, decr); + INSTALL_BINOP (add, octave_integer, octave_integer, add); INSTALL_BINOP (sub, octave_integer, octave_integer, sub); INSTALL_BINOP (mul, octave_integer, octave_integer, mul);