1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2// Copyright (C) INRIA 3// 4// Copyright (C) 2012 - 2016 - Scilab Enterprises 5// 6// This file is hereby licensed under the terms of the GNU GPL v2.0, 7// pursuant to article 5.3.4 of the CeCILL v.2.1. 8// This file was originally licensed under the terms of the CeCILL v2.1, 9// and continues to be available under such terms. 10// For more information, see the COPYING file which you should have received 11// along with this program. 12 13function i1=%i_x_i(i1,i2) 14 t1=inttype(i1); t2=inttype(i2); 15 //logical promotions 16 if t1<10 & t2<10 then t=max(t1,t2); end 17 if t1>10 & t2>10 then t=max(t1,t2); end 18 //more arbitrary promotions 19 if t1<10 & t2>10 then t=max(t1+10,t2); end 20 if t1>10 & t2<10 then t=max(t1,t2+10); end 21 // i1=iconvert(i1,t) .* iconvert(i2,t) 22 i1 = iconvert(double(i1) .* double(i2), t); 23endfunction 24