from
slatec
by Ben Barrowes The slatec library converted into matlab functions.
[x,iy,z]=mpmuli(x,iy,z);
function [x,iy,z]=mpmuli(x,iy,z);
%***BEGIN PROLOGUE MPMULI
%***SUBSIDIARY
%***PURPOSE Subsidiary to DQDOTA and DQDOTI
%***LIBRARY SLATEC
%***TYPE ALL (MPMULI-A)
%***AUTHOR (UNKNOWN)
%***DESCRIPTION
%
% Multiplies 'mp' X by single-precision integer IY giving 'mp' Z.
% This is faster than using MPMUL. Result is ROUNDED.
% Multiplication by 1 may be used to normalize a number
% even if the last digit is B.
%
%***SEE ALSO DQDOTA, DQDOTI
%***ROUTINES CALLED MPMUL2
%***REVISION HISTORY (YYMMDD)
% 791001 DATE WRITTEN
% 890831 Modified array declarations. (WRB)
% 891214 Prologue converted to Version 4.0 format. (BAB)
% 900402 Added TYPE section. (WRB)
%***end PROLOGUE MPMULI
x_shape=size(x);x=reshape(x,1,[]);
z_shape=size(z);z=reshape(z,1,[]);
%***FIRST EXECUTABLE STATEMENT MPMULI
[x,iy,z]=mpmul2(x,iy,z,0);
x_shape=zeros(x_shape);x_shape(:)=x(1:numel(x_shape));x=x_shape;
z_shape=zeros(z_shape);z_shape(:)=z(1:numel(z_shape));z=z_shape;
end
%DECK MPNZR