octave-maintainers
[Top][All Lists]
Advanced

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

Operations with int and single


From: Israel Herraiz
Subject: Operations with int and single
Date: Thu, 13 Sep 2012 10:33:11 +0200
User-agent: Sup/git

Hi,

I have noticed that Octave behavior when operating with int and single
variables differs from MATLAB.

In Octave this works:

 octave:1> int16(3)+single(4)
 ans = 7

However, the same operation in MATLAB:

 >> int16(3)+single(4)
 Error using +
 Integers can only be combined with integers of the same class, or scalar 
doubles.

In general, in MATLAB, int variables (int8, int16, uint8, etc) can
only operate with integers of the same class, or with doubles, but not
with singles.

Is this behavior in Octave intended?

Thanks.

Israel


reply via email to

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