From d53da65c02f2dd45ea02dfeb4094e10cadc1965e Mon Sep 17 00:00:00 2001 From: Brad Roberts Date: Mon, 10 Sep 2007 04:55:20 +0000 Subject: [PATCH] phobos 0.138 --- std/math.d | 3 ++- std/math2.d | 22 ---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/std/math.d b/std/math.d index d800ea52e..b3a55087c 100644 --- a/std/math.d +++ b/std/math.d @@ -50,6 +50,7 @@ module std.math; //debug=math; // uncomment to turn on debugging printf's +private import std.stdio; private import std.c.stdio; private import std.string; private import std.c.math; @@ -1641,7 +1642,7 @@ body } else { - i = A.length - 1; + int i = A.length - 1; real r = A[i]; while (--i >= 0) { diff --git a/std/math2.d b/std/math2.d index a3eddec6b..80280c360 100644 --- a/std/math2.d +++ b/std/math2.d @@ -114,28 +114,6 @@ unittest assert(feq(frac(-123.456), -0.456L)); } -/********************************* - * Polynomial of X - */ - -real poly(real x, real[] coefficients) -{ - debug (math2) printf("poly(), coefficients.length = %d\n", coefficients.length); - if (!coefficients.length) - return 0; - real result = coefficients[coefficients.length - 1]; - for (int i = coefficients.length - 2; i >= 0; i--) - result = result * x + coefficients[i]; - return result; -} - -unittest -{ - debug (math2) printf("unittest.poly()\n"); - static real[4] k = [ 4, 3, 2, 1 ]; - assert(feq(poly(2, k), cast(real) 8 * 1 + 4 * 2 + 2 * 3 + 4)); -} - /********************************* * Sign */