http://d.puremagic.com/issues/show_bug.cgi?id=4810
Summary: dotProduct problem with ints Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-09-04 06:18:42 PDT --- With DMD 2.048 this dotProduct doesn't work: import std.numeric; void main() { assert(dotProduct([1, 3, -5], [4, -2, -1]) == 3); } This is the first part of dotProduct: Unqual!(CommonType!(F1, F2)) dotProduct(F1, F2)(in F1[] avector, in F2[] bvector) { immutable n = avector.length; assert(n == bvector.length); auto avec = avector.ptr, bvec = bvector.ptr; typeof(return) sum0 = 0.0, sum1 = 0.0; To fix it replace this: typeof(return) sum0 = 0.0, sum1 = 0.0; With: typeof(return) sum0 = 0, sum1 = 0; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------