[471bfe]: @mp / abs.m  Maximize  Restore  History

Download this file

20 lines (17 with data), 541 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function out = abs(x)
precision = max (getPrecs (x(:)));
[out_rval, out_ival] = deal (cell (size (x)));
for ii = (1:numel (x))
[xrval, xival] = getVals (x, ii);
if (hasimag (xival))
out_rval{ii} = mpfr_absc (double (precision), xrval, xival);
elseif (strncmp (xrval, '-', 1))
out_rval{ii} = xrval(2:end);
else
out_rval{ii} = xrval;
end
end % for ii=1:max(ex,
out = mp (struct ('rval', out_rval,...
'ival', out_ival,...
'precision', precision));
end

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks