From 3710c23789342d9d88783cbe9ad23eb5263a7c33 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 7 Aug 2020 03:02:55 +0000 Subject: CTAN sync 202008070302 --- graphics/asymptote/mathop.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'graphics/asymptote/mathop.h') diff --git a/graphics/asymptote/mathop.h b/graphics/asymptote/mathop.h index aba85d39a4..3c5da5b73c 100644 --- a/graphics/asymptote/mathop.h +++ b/graphics/asymptote/mathop.h @@ -71,7 +71,7 @@ template struct minus { T operator() (T x, T y, size_t=0) {return x-y;} }; - + template struct times { T operator() (T x, T y, size_t=0) {return x*y;} @@ -87,9 +87,9 @@ struct timesR { T operator () (T y, double x, size_t=0) {return x*y;} }; -extern void dividebyzero(size_t i=0); -extern void integeroverflow(size_t i=0); - +extern void dividebyzero(size_t i=0); +extern void integeroverflow(size_t i=0); + template struct divide { T operator() (T x, T y, size_t i=0) { @@ -106,20 +106,20 @@ struct divide { inline bool validInt(double x) { return x > Int_MIN-0.5 && x < Int_MAX+0.5; } - + inline void checkInt(double x, size_t i) { if(validInt(x)) return; integeroverflow(i); } - + inline Int Intcast(double x) { if(validInt(x)) return (Int) x; integeroverflow(0); return 0; } - + template<> struct plus { Int operator() (Int x, Int y, size_t i=0) { @@ -143,7 +143,7 @@ struct times { Int operator() (Int x, Int y, size_t i=0) { if(y == 0) return 0; if(y < 0) {y=-y; x=-x;} - if((y > int_MAX || x > int_MAX/(int) y || x < int_MIN/(int) y) && + if((y > int_MAX || x > int_MAX/(int) y || x < int_MIN/(int) y) && (x > Int_MAX/y || x < Int_MIN/y)) integeroverflow(i); return x*y; @@ -169,7 +169,7 @@ inline Int Negate(Int x, size_t i=0) { if(x < -Int_MAX) integeroverflow(i); return -x; } - + template<> inline void Negate(vm::stack *s) { @@ -187,7 +187,7 @@ T pow(T x, Int y) if(y == 0) return 1.0; if(x == 0.0 && y > 0) return 0.0; if(y < 0) {y=-y; x=1/x;} - + T r=1.0; for(;;) { if(y & 1) r *= x; @@ -195,7 +195,7 @@ T pow(T x, Int y) x *= x; } } - + template struct power { T operator() (T x, T y, size_t=0) {return pow(x,y);} @@ -233,7 +233,7 @@ struct power { } } }; - + template struct mod { T operator() (T x, T y, size_t i=0) { @@ -299,7 +299,7 @@ struct maxbound { }; template -void realReal(vm::stack *s) +void realReal(vm::stack *s) { double x=vm::pop(s); s->push(func(x)); -- cgit v1.2.3