On 14/08/12 05:03, TJB wrote:
On Monday, 13 August 2012 at 10:11:06 UTC, Don Clugston wrote:

 ... I have come to believe that there are very few algorithms
originally designed for integers, which also work correctly for
floating point.

Integer code nearly always assumes things like, x + 1 != x, x == x,
(x + y) - y == x.


for (y = x; y < x + 10; y = y + 1) { .... }

How many times does it loop?

Don,

I would appreciate your thoughts on the issue of re-implementing numeric
codes like BLAS and LAPACK in pure D to benefit from the many nice
features listed in this discussion.  Is it feasible? Worthwhile?

Thanks,

TJB

I found that when converting code for Special Functions from C to D, the code quality improved enormously. Having 'static if' and things like float.epsilon as built-ins makes a surprisingly large difference. It encourages correct code. (For example, it makes any use of magic numbers in the code look really ugly and wrong). Unit tests help too.

That probably doesn't apply so much to LAPACK and BLAS, but it would be interesting to see how far we can get with the new SIMD support.

Reply via email to