From help-request at octave dot org Sat Feb 12 09:57:13 2005 Subject: Data types (was: Re: Access the neighbors of an element) From: "John W. Eaton" To: Joerg Sommer Cc: help at octave dot org Date: Sat, 12 Feb 2005 11:03:01 -0500 On 12-Feb-2005, Joerg Sommer wrote: | "John W. Eaton" wrote: | > On 12-Feb-2005, Joerg Sommer wrote: | > | > | Is it possible to tell octave it should use integer data types? I don't | > | need floating point operations. | > | > As of 2.1.64, Octave has integer data types with operations that | > should be compatible with Matlab 7.x. There are the usual +, -, .*, | > ./, etc. ops on signed and unsigned 8-, 16-, and 32-bit integer types. | | How are data types set? x = int8 ([1,2;3,4]) or x = ones (dims, "int8") | > Unfortuantely, compatibility dictates that the operations on the | > elements are done using doubles with the result converted back to ints | | And a switch "matlab_compatible=0"? No, I don't think built-in variables that change the behavior of fundamental language features are a good idea. It is OK to change output formats or things like that. But I don't think you really want someone to be able to set a variable in their .octaverc file and suddenly get different results without any clue about why that happened. Octave had a lot of these kinds of variables in the past. Most have been removed because they caused more problems than they solved. | Or special octave types? No, but you could define your own and contribute them. jwe ------------------------------------------------------------- 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 -------------------------------------------------------------