| 1 |
\NeedsTeXFormat{LaTeX2e} |
| 2 |
\ProvidesPackage{fp-addons}[1995/03/15] |
| 3 |
|
| 4 |
\def\FP@addonsversion{0.1} |
| 5 |
\message{% |
| 6 |
`Fixed Point Arithmetic Addons',\space% |
| 7 |
Version \FP@addonsversion\space% |
| 8 |
\space(C) Michael Mehlich% |
| 9 |
\space\space\space\space\space\space\space% |
| 10 |
\space\space\space\space\space\space\space% |
| 11 |
} |
| 12 |
|
| 13 |
%%%public area (macros which may be used)%%% |
| 14 |
|
| 15 |
\def\FPmin#1#2#3{\FP@min#1{#2}{#3}} % #1:=min(#2,#3) |
| 16 |
\def\FPmax#1#2#3{\FP@max#1{#2}{#3}} % #1:=max(#2,#3) |
| 17 |
|
| 18 |
%%%private fp-area (don't use these macros)%%% |
| 19 |
|
| 20 |
%compute minimum of two values |
| 21 |
\def\FP@min#1#2#3{% |
| 22 |
% #1 macro, which gets the result |
| 23 |
% #2 value one |
| 24 |
% #3 value two |
| 25 |
\FP@beginmessage{MIN}% |
| 26 |
% |
| 27 |
{\def\FP@beginmessage##1{}% |
| 28 |
\def\FP@endmessage##1{}% |
| 29 |
% |
| 30 |
\FPiflt{#2}{#3}% |
| 31 |
\edef\FP@tmp{#2}% |
| 32 |
\else% |
| 33 |
\edef\FP@tmp{#3}% |
| 34 |
\fi% |
| 35 |
% |
| 36 |
\global\let\FP@tmp\FP@tmp% |
| 37 |
}% |
| 38 |
% |
| 39 |
\FP@endmessage{}% |
| 40 |
% |
| 41 |
\let#1\FP@tmp% |
| 42 |
} |
| 43 |
|
| 44 |
%compute maximum of two values |
| 45 |
\def\FP@max#1#2#3{% |
| 46 |
% #1 macro, which gets the result |
| 47 |
% #2 value one |
| 48 |
% #3 value two |
| 49 |
\FP@beginmessage{MAX}% |
| 50 |
% |
| 51 |
{\def\FP@beginmessage##1{}% |
| 52 |
\def\FP@endmessage##1{}% |
| 53 |
% |
| 54 |
\FPifgt{#2}{#3}% |
| 55 |
\edef\FP@tmp{#2}% |
| 56 |
\else% |
| 57 |
\edef\FP@tmp{#3}% |
| 58 |
\fi% |
| 59 |
% |
| 60 |
\global\let\FP@tmp\FP@tmp% |
| 61 |
}% |
| 62 |
% |
| 63 |
\FP@endmessage{}% |
| 64 |
% |
| 65 |
\let#1\FP@tmp% |
| 66 |
} |