@@ -443,7 +443,7 @@ struct Summator(T, Summation summation)
443443 static if (summation == Summation.precise)
444444 {
445445 import std.internal.scopebuffer ;
446- import std.math : isInfinity, isFinite, isNaN, signbit ;
446+ static import std.math ;
447447 private :
448448 enum F M = (cast (F)(2 )) ^^ (T.max_exp - 1 );
449449 F[16 ] scopeBufferArray = void ;
@@ -468,7 +468,7 @@ struct Summator(T, Summation summation)
468468 static F partialsReduce (F s, in F[] partials)
469469 in
470470 {
471- debug (numeric) assert (! partials.length || s. isFinite);
471+ debug (numeric) assert (! partials.length || std.math. isFinite(s) );
472472 }
473473 body
474474 {
@@ -478,15 +478,15 @@ struct Summator(T, Summation summation)
478478 s = partialsReducePred(s, y, i ? partials[i- 1 ] : 0 , _break);
479479 if (_break)
480480 break ;
481- debug (numeric) assert (s. isFinite);
481+ debug (numeric) assert (std.math. isFinite(s) );
482482 }
483483 return s;
484484 }
485485
486486 static F partialsReducePred (F s, F y, F z, out bool _break)
487487 out (result)
488488 {
489- debug (numeric) assert (result. isFinite);
489+ debug (numeric) assert (std.math. isFinite(result) );
490490 }
491491 body
492492 {
@@ -496,9 +496,9 @@ struct Summator(T, Summation summation)
496496 F l = y - d;
497497 debug (numeric)
498498 {
499- assert (x. isFinite);
500- assert (y. isFinite);
501- assert (s. isFinite);
499+ assert (std.math. isFinite(x) );
500+ assert (std.math. isFinite(y) );
501+ assert (std.math. isFinite(s) );
502502 assert (fabs(y) < fabs(x));
503503 }
504504 if (l)
@@ -507,7 +507,7 @@ struct Summator(T, Summation summation)
507507 // Needed so that sum([1e-16, 1, 1e16]) will round-up the last
508508 // digit to two instead of down to zero (the 1e-16 makes the 1
509509 // slightly closer to two). Can guarantee commutativity.
510- if (z && ! signbit(l * z))
510+ if (z && ! std.math. signbit (l * z))
511511 {
512512 l *= 2 ;
513513 x = s + l;
@@ -521,11 +521,11 @@ struct Summator(T, Summation summation)
521521 }
522522
523523 // Returns corresponding infinity if is overflow and 0 otherwise.
524- F overflow () const
524+ F overflow ()() const
525525 {
526526 if (o == 0 )
527527 return 0 ;
528- if (partials.length && (o == - 1 || o == 1 ) && signbit(o * partials[$- 1 ]))
528+ if (partials.length && (o == - 1 || o == 1 ) && std.math. signbit (o * partials[$- 1 ]))
529529 {
530530 // problem case: decide whether result is representable
531531 F x = o * M;
@@ -544,7 +544,7 @@ struct Summator(T, Summation summation)
544544 else
545545 {
546546 if (! std.math.isInfinity (cast (T)y) ||
547- ((partials.length > 1 && ! signbit(l * partials[$- 2 ])) && t == l))
547+ ((partials.length > 1 && ! std.math. signbit (l * partials[$- 2 ])) && t == l))
548548 return 0 ;
549549 }
550550 }
@@ -604,7 +604,7 @@ struct Summator(T, Summation summation)
604604public :
605605
606606 // /
607- this (T n)
607+ this ()( T n)
608608 {
609609 static if (summation == Summation.precise)
610610 {
@@ -670,6 +670,7 @@ public:
670670 static if (summation == Summation.precise)
671671 ~this ()
672672 {
673+ version (LDC ) pragma (inline, true );
673674 partials.free;
674675 }
675676
@@ -706,7 +707,7 @@ public:
706707 F t = x; x = y; y = t;
707708 }
708709 // h == -F.infinity
709- if (signbit(h))
710+ if (std.math. signbit (h))
710711 {
711712 x += M;
712713 x += M;
@@ -990,7 +991,7 @@ public:
990991 +/
991992 version (none )
992993 static if (summation == Summation.precise)
993- package void unsafePut(F x)
994+ package void unsafePut()( F x)
994995 in {
995996 assert (std.math.isFinite (x));
996997 }
@@ -1026,7 +1027,7 @@ public:
10261027 }
10271028
10281029 // /Returns the value of the sum.
1029- T sum () const
1030+ T sum ()() const
10301031 {
10311032 /+ +
10321033 Returns the value of the sum, rounded to the nearest representable
@@ -1062,7 +1063,7 @@ public:
10621063 if (o)
10631064 {
10641065 immutable F of = o;
1065- if (y && (o == - 1 || o == 1 ) && signbit(of * y))
1066+ if (y && (o == - 1 || o == 1 ) && std.math. signbit (of * y))
10661067 {
10671068 // problem case: decide whether result is representable
10681069 y /= 2 ;
@@ -1076,7 +1077,7 @@ public:
10761077 // overflow, except in edge case...
10771078 x = h + l;
10781079 t = x - h;
1079- y = parts.length && t == l && ! signbit(l* parts[$- 1 ]) ?
1080+ y = parts.length && t == l && ! std.math. signbit (l* parts[$- 1 ]) ?
10801081 x * 2 :
10811082 F.infinity * of;
10821083 parts = null ;
@@ -1142,7 +1143,7 @@ public:
11421143
11431144 version (none )
11441145 static if (summation == Summation.precise)
1145- F partialsSum () const
1146+ F partialsSum ()() const
11461147 {
11471148 debug (numeric) partialsDebug;
11481149 auto parts = partials[];
@@ -1530,45 +1531,45 @@ public:
15301531 static if (summation == Summation.precise)
15311532 {
15321533 // /Returns `true` if current sum is a NaN.
1533- bool isNaN () const
1534+ bool isNaN ()() const
15341535 {
15351536 return std.math.isNaN (s);
15361537 }
15371538
15381539 // /Returns `true` if current sum is finite (not infinite or NaN).
1539- bool isFinite () const
1540+ bool isFinite ()() const
15401541 {
15411542 if (s)
15421543 return false ;
15431544 return ! overflow;
15441545 }
15451546
15461547 // /Returns `true` if current sum is ±∞.
1547- bool isInfinity () const
1548+ bool isInfinity ()() const
15481549 {
15491550 return std.math.isInfinity (s) || overflow();
15501551 }
15511552 }
15521553 else static if (isFloatingPoint! F)
15531554 {
15541555 // /Returns `true` if current sum is a NaN.
1555- bool isNaN () const
1556+ bool isNaN ()() const
15561557 {
1557- import std.math : isNaN ;
1558+ static import std.math ;
15581559 return std.math.isNaN (sum());
15591560 }
15601561
15611562 // /Returns `true` if current sum is finite (not infinite or NaN).
1562- bool isFinite () const
1563+ bool isFinite ()() const
15631564 {
1564- import std.math : isFinite ;
1565+ static import std.math ;
15651566 return std.math.isFinite (sum());
15661567 }
15671568
15681569 // /Returns `true` if current sum is ±∞.
1569- bool isInfinity () const
1570+ bool isInfinity ()() const
15701571 {
1571- import std.math : isInfinity ;
1572+ static import std.math ;
15721573 return std.math.isInfinity (sum());
15731574 }
15741575 }
0 commit comments