summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/mathop.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-12 22:54:35 +0000
committerKarl Berry <karl@freefriends.org>2016-05-12 22:54:35 +0000
commitf0e23ed3daf4d57345cfa284164276b520302c03 (patch)
tree3e5b0729899d1e124eec7996df94fd9f7e688d05 /Build/source/utils/asymptote/mathop.h
parentbd459bc63bbacb77224c9d858759541096c095c8 (diff)
asy 2.38 sources
git-svn-id: svn://tug.org/texlive/trunk@41074 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/mathop.h')
-rw-r--r--Build/source/utils/asymptote/mathop.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/mathop.h b/Build/source/utils/asymptote/mathop.h
index 572a9f7ee1b..1fda216e592 100644
--- a/Build/source/utils/asymptote/mathop.h
+++ b/Build/source/utils/asymptote/mathop.h
@@ -247,6 +247,16 @@ struct mod {
};
template <typename T>
+struct quotient {
+ T operator() (T x, T y, size_t i=0) {
+ if(y == 0) dividebyzero(i);
+ if(y == -1) return Negate(x);
+// Implementation-independent definition of integer division: round down
+ return (x-portableMod(x,y))/y;
+ }
+};
+
+template <typename T>
struct min {
T operator() (T x, T y, size_t=0) {return x < y ? x : y;}
};