pike.git / src / modules / Math / testsuite.in

version» Context lines:

pike.git/src/modules/Math/testsuite.in:1:   START_MARKER - define(MATRIX_EQUAL,[[ -  (max(@map(Array.flatten( (array) (($1)-($2)) ),abs))<1e-5) - ]]) +       define(MATRIX_CONVOLVE_TEST,[[   test_any([[ -  Math.Matrix a=]]$1[[; -  Math.Matrix b=]]$2[[; -  Math.Matrix r=]]$3[[; + #define MATRIX_EQUAL(A,B) (max(@map(Array.flatten( (array) ((A)-(B)) ),abs))<1e-5) +  +  Math.Matrix a=$1; +  Math.Matrix b=$2; +  Math.Matrix r=$3;    Math.Matrix r1=a->convolve(b);    Math.Matrix r2=b->convolve(a); -  if (!]]MATRIX_EQUAL(r1,r2)[[) +  if (!MATRIX_EQUAL(r1,r2))    error("convolving \na=%O,\nb=%O\n"    "gave different results depending on order:\n"    "a->convolve(b):\n%O\n"    "b->convolve(a):\n%O\n"    "expected:\n%O\n",    a,b,r1,r2,r); -  if (!]]MATRIX_EQUAL(r1,r)[[) +  if (!MATRIX_EQUAL(r1,r))    error("convolving \n%O,\n%O\n"    "gave erranous result,\n%O,\nexpected\n%O\n",    a,b,r1,r);    return 1;    ]],1)   ]])         MATRIX_CONVOLVE_TEST(    Math.Matrix( ({0,0,0, 0,1,0, 0,0,0})/3 ),
pike.git/src/modules/Math/testsuite.in:233:   test_convert(90, "rad", "gon")   test_convert(90, "gon", "str")   test_convert(90, "str", "deg")      test_approx(Math.log2(64.0), 6.0)   test_approx(Math.log10(100.0), 2.0)   test_approx(Math.logn(3.0, 81.0), 4.0)      test_true( floatp(Math.e) )   test_true( floatp(Math.pi) ) +  + test_equal(Math.factor(-1), ({ -1 })) + test_equal(Math.factor(0), ({ 0 })) + test_equal(Math.factor(1), ({ 1 })) + test_equal(sort(Math.factor(10003)), ({ 7, 1429 })) +    END_MARKER