1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2015 - 2016 - Samuel GOUGEON
3 // Copyright (C) 2012 - 2016 - Scilab Enterprises
5 // This file is hereby licensed under the terms of the GNU GPL v2.0,
6 // pursuant to article 5.3.4 of the CeCILL v.2.1.
7 // This file was originally licensed under the terms of the CeCILL v2.1,
8 // and continues to be available under such terms.
9 // For more information, see the COPYING file which you should have received
10 // along with this program.
12 // Beware about the bug http://bugzilla.scilab.org/14460
14 function r = %sp_sign(m)
18 r(c) = m(c) ./ abs(m(c))
23 r(find(im==0 & re>0)) = 1
24 r(find(im==0 & re<0)) = -1