\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{fp-addons}[1995/03/15]

\def\FP@addonsversion{0.1}
\message{%
  `Fixed Point Arithmetic Addons',\space%
  Version \FP@addonsversion\space%
  \space(C) Michael Mehlich%
  \space\space\space\space\space\space\space%
  \space\space\space\space\space\space\space%
}

%%%public area (macros which may be used)%%%

\def\FPmin#1#2#3{\FP@min#1{#2}{#3}} % #1:=min(#2,#3)
\def\FPmax#1#2#3{\FP@max#1{#2}{#3}} % #1:=max(#2,#3)

%%%private fp-area (don't use these macros)%%%

%compute minimum of two values
\def\FP@min#1#2#3{%
  % #1 macro, which gets the result
  % #2 value one
  % #3 value two
  \FP@beginmessage{MIN}%
  %
  {\def\FP@beginmessage##1{}%
   \def\FP@endmessage##1{}%
   %
   \FPiflt{#2}{#3}%
     \edef\FP@tmp{#2}%
   \else%
     \edef\FP@tmp{#3}%
   \fi%
   %
   \global\let\FP@tmp\FP@tmp%
  }
  %
  \FP@endmessage{}%
  %
  \let#1\FP@tmp%
}

%compute maximum of two values
\def\FP@max#1#2#3{%
  % #1 macro, which gets the result
  % #2 value one
  % #3 value two
  \FP@beginmessage{MAX}%
  %
  {\def\FP@beginmessage##1{}%
   \def\FP@endmessage##1{}%
   %
   \FPifgt{#2}{#3}%
     \edef\FP@tmp{#2}%
   \else%
     \edef\FP@tmp{#3}%
   \fi%
   %
   \global\let\FP@tmp\FP@tmp%
  }
  %
  \FP@endmessage{}%
  %
  \let#1\FP@tmp%
}
