help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

testing for uint8: a solution


From: Brian Blais
Subject: testing for uint8: a solution
Date: Sat, 04 Jun 2005 20:13:00 -0400
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Hello,

I found the following solution for testing whether a variable is uint8 (a question I had asked some time ago). Is there anything wrong with using this solution?

int is_uint8(const octave_value &val) {

  if ((val.type_id() == octave_uint8_matrix::static_type_id()) ||
      (val.type_id () == octave_uint8_scalar::static_type_id())) {
    return(1);
  } else {
    return(0);
  }

}


        thanks,

                        bb

--
-----------------

            address@hidden
            http://web.bryant.edu/~bblais



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]