Ah yes indeed that is a very good reason when the function is parametric in two different types. Maybe it would be more elgegant to have a zero version that takes multiple arguments and calls promote internally.
Am Donnerstag, 24. April 2014 13:05:10 UTC+2 schrieb Alex: > > > The usage of construct like zero(zero(T)*zero(T)) is not really easy to >> understand. I assume you propose this due to the upcasting arithmetic >> integer behavior of non-native integer types (int16, ...), right? >> >> Basically, I wanted to avoid that r changes its type in the loop (this > might be more evident/relevant if the elements of x and y have different > types, say Real and Complex). I don't know if it matters much in this case, > though. > > Best, > > Alex. >
