[Issue 12170] sum(double[]) is not pure nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 27 04:05:28 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12170


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #4 from monarchdodra at gmail.com 2014-02-27 04:05:25 PST ---
(In reply to comment #3)
> Until that compiler limitation is lifted, a solution is to convert the
> recursive algorithm of sum() in an iterative one. Because sum() is something
> you often want to use in pure nothrow functions.

Well, "sum" is specifically implemented to do pair-wise sumation of floats, to
reduce computational error, as opposed to the "dumber" "member by member" sum.

The idea would be to transform the recursive algorithm into an iterative one,
but (AFAIK), this usually requires a stack-type structure.

Either that, or request better inference for cyclic functions.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list