Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[dc5f16]: @mp / log.m Maximize Restore History

Download this file

log.m    18 lines (15 with data), 501 Bytes

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