GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-uint16.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2015 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include <iostream>
28 #include <limits>
29 
30 #include "lo-ieee.h"
31 #include "lo-utils.h"
32 #include "mx-base.h"
33 #include "quit.h"
34 
35 #include "defun.h"
36 #include "gripes.h"
37 #include "oct-obj.h"
38 #include "oct-lvalue.h"
39 #include "oct-hdf5.h"
40 #include "ops.h"
41 #include "ov-base.h"
42 
43 #include "ov-base-int.h"
44 #include "ov-base-int.cc"
45 #include "ov-uint16.h"
46 #include "ov-type-conv.h"
47 #include "pr-output.h"
48 #include "variables.h"
49 
50 #include "byte-swap.h"
51 #include "ls-oct-ascii.h"
52 #include "ls-utils.h"
53 #include "ls-hdf5.h"
54 
56 
58 
59 
60 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint16_matrix,
61  "uint16 matrix", "uint16");
62 
64 
66 
67 
68 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint16_scalar,
69  "uint16 scalar", "uint16");
70 
71 DEFUN (uint16, args, ,
72  "-*- texinfo -*-\n\
73 @deftypefn {Built-in Function} {} uint16 (@var{x})\n\
74 Convert @var{x} to unsigned 16-bit integer type.\n\
75 @seealso{int8, uint8, int16, int32, uint32, int64, uint64}\n\
76 @end deftypefn")
77 {
78  OCTAVE_TYPE_CONV_BODY (uint16);
79 }
80 
81 /*
82 %!assert (class (uint16 (1)), "uint16")
83 %!assert (uint16 (1.25), uint16 (1))
84 %!assert (uint16 (1.5), uint16 (2))
85 %!assert (uint16 (-1.5), uint16 (0))
86 %!assert (uint16 (2^17), uint16 (2^16-1))
87 %!assert (uint16 (-2^17), uint16 (0))
88 */
#define OCTAVE_TYPE_CONV_BODY(NAME)
Definition: ov-type-conv.h:106
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:44
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
Definition: ov-base.h:164