Closed JuliusHerrmann closed 1 year ago
Thanks for the issue, however this functionality was removed in #15 as it doesn't work in the general case! While the product of ratios is still a ratio the product of other quantities is not that same quantity. e.g. Length length = area. Length length * length = volume. Product requires that all items are of the same type and the result is also that same type.
Hi everyone, this is my first contribution/issue so please correct me on anything :). During a university course I came across the problem of calculating the product of an iterator of
Ratio
s. This is an example that would not work but I think should be possible:I searched around a bit and came across the "num" crate. This implements Ratio and product of ratios, so I think it should be possible for "uom" to do the same. This here works in the "num" crate:
In the end I used
which worked. Which leads me to the conclusion that there is no fundamental problem hindering the support of product on ratios.
To sum it up I think product over ratios should/could be supported. Thanks :)