summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fp/fp-addons.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/fp/fp-addons.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fp/fp-addons.sty66
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%
+}