Code covered by the BSD License  

Highlights from
slatec

from slatec by Ben Barrowes
The slatec library converted into matlab functions.

[x,y,n]=r9upak(x,y,n);
function [x,y,n]=r9upak(x,y,n);
persistent absx ; 

if isempty(absx), absx=0; end;
%***BEGIN PROLOGUE  R9UPAK
%***PURPOSE  Unpack a floating point number X so that X = Y*2**N.
%***LIBRARY   SLATEC (FNLIB)
%***CATEGORY  A6B
%***TYPE      SINGLE PRECISION (R9UPAK-S, D9UPAK-D)
%***KEYWORDS  FNLIB, UNPACK
%***AUTHOR  Fullerton, W., (LANL)
%***DESCRIPTION
%
%   Unpack a floating point number X so that X = Y*2.0**N, where
%   0.5 .LE. ABS(Y) .LT. 1.0.
%
%***REFERENCES  (NONE)
%***ROUTINES CALLED  (NONE)
%***REVISION HISTORY  (YYMMDD)
%   780701  DATE WRITTEN
%   861211  REVISION DATE from Version 3.2
%   891214  Prologue converted to Version 4.0 format.  (BAB)
%***end PROLOGUE  R9UPAK
%***FIRST EXECUTABLE STATEMENT  R9UPAK
absx = abs(x);
n = 0;
if( x==0.0e0 )
%
y = (abs(absx).*sign(x));
else;
%
while( absx<0.5e0 );
n = fix(n - 1);
absx = absx.*2.0e0;
end;
%
while( absx>=1.0e0 );
n = fix(n + 1);
absx = absx.*0.5e0;
end;
y = (abs(absx).*sign(x));
end;
%
end %subroutine r9upak
%DECK RADB2

Contact us at files@mathworks.com