We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
using Unitful a = 1.0u"m" one(eltype(a))
I would expect it to return one unit, but it just returns 1.0.
The text was updated successfully, but these errors were encountered:
The current behavior is correct, since one returns the multiplicative identity element, i.e., x * one(x) == x.
one
x * one(x) == x
Sorry, something went wrong.
whats the best way to get the quantity one? e.g.,
one(eltype(x))*Unitful.unit(x[1])
oneunit(x) (or oneunit(eltype(x)), since it looks like you are operating on arrays)
oneunit(x)
oneunit(eltype(x))
No branches or pull requests
I would expect it to return one unit, but it just returns 1.0.
The text was updated successfully, but these errors were encountered: