r-quantities/units

Integer powers above 1

Closed this issue · 3 comments

Thanks again for the great package! Are there any plans to allow non-integer exponents greater than 1?

> set_units(5, m^2)^(3/2)
Error in Ops.units(set_units(5, m^2), (3/2)) : 
  currently you can only take integer powers of units above 1

Good point. We'll look into this.

@Enchufa2 Thanks for the fix!

A related issue is for setting numbers that actually have non-integer units. e.g.:

> set_units(1, cm^(3/2))
Error: currently you can only take integer powers of units above 1
Did you try to supply a value in a context where a bare expression was expected?

Should I open a new issue for this?
Thanks!
Egor

No, that is actually intended: non-integer exponents have no physical meaning and are not supported by UDUNITS-2, so units won't support them either.