1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) DIGITEO - 2012 - Cedric Delamarre
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 x = %i_y_i(a, b)
14
15    t1=inttype(a); t2=inttype(b);
16    //logical promotions
17    if t1<10 & t2<10 then t=max(t1,t2); end
18    if t1>10 & t2>10 then t=max(t1,t2); end
19    //more arbitrary promotions
20    if t1<10 & t2>10 then t=max(t1,t2-10); end
21    if t1>10 & t2<10 then t=max(t1-10,t2); end
22
23    x = iconvert(double(a) ./. double(b), t);
24
25endfunction
26