diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:56:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:56:09 +0000 |
commit | 3c45ead856093bda97671c92bbc3fa9768918e91 (patch) | |
tree | 7cd45d8624b1693f5f61f9221074075d817feab2 /Master/texmf-dist/tex/latex/fp/fp-addons.sty | |
parent | f608edbff24385a77c97e230f31fe5c1fb422a71 (diff) |
fp
git-svn-id: svn://tug.org/texlive/trunk@939 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fp/fp-addons.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fp/fp-addons.sty | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/fp/fp-addons.sty b/Master/texmf-dist/tex/latex/fp/fp-addons.sty new file mode 100644 index 00000000000..d91057d2eb0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fp/fp-addons.sty @@ -0,0 +1,66 @@ +\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% +} |