Keno / SIUnits.jl

Efficient unit-checked computation
Other
70 stars 26 forks source link

Promotion of identical SIQuantities shouldn't be concrete #35

Closed mbauman closed 10 years ago

mbauman commented 10 years ago

The default fallback for promote_type in Base assumes that the promotion of two identical types is precisely that type itself. Unfortunately, this is not true for SIQuantities, as they may be getting divided or multiplied and so we cannot infer the resulting type. This is particularly important within array operations, where division of identical types previously resulted in the wrong type and multiplication threw a conversion error (since this was used in the preallocation of the resulting array).

Fixes #27.

mbauman commented 10 years ago

I'm still getting used to the idea of pushing to other folks' repositories, but I'm pretty sure this is the right thing to do here. You're always welcome to revert. :)

Keno commented 10 years ago

Looks good, thanks!