http://d.puremagic.com/issues/show_bug.cgi?id=5866



--- Comment #2 from bearophile_h...@eml.cc 2011-04-20 09:44:40 PDT ---
(In reply to comment #1)
> float  = float * float + float
> 
> contains a conversion from double to float.

Thank you for your comment. In programming I'm always finding new and new ways
to be wrong or just to show ignorance :-) But this program, gives no errors
with DMD 2.052:


float f1() { return 1.0f; }
float f2() { return 2.0f; }
float f3() { return 3.0f; }
void main() {
    static assert(is(typeof(f1() * f2()) == float));
    static assert(is(typeof(f1() * f2() + f3()) == float));
    float result;
    static assert(is(typeof(result = f1() * f2() + f3()) == float));
}


And a good C lint gives no double->error warnings in this C program:

float f1() { return 1.0f; }
float f2() { return 2.0f; }
float f3() { return 3.0f; }
int main() {
    float result = f1() * f2() + f3();
    return 0;
}


So where's the double->float conversion?

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

Reply via email to