3 ms·
You can do this: julia> using Unitful.DefaultSymbols julia> 50m / s 50 m s^-1
by sents 7y ago
You can do this:
julia> using Unitful.DefaultSymbols
julia> 50m / s
50 m s^-1
- dunefox 7y agoNice, that's much better.
- ChrisRackauckas 7y agoAnd you can manually define them: const m = u"m" 50m There's actually nothing special in the compiler for unit implementation. This is just using the fact that `2x` is valid Julia code, where now x is something that overloads a dispatch to turn the number into a number with units. By default it uses string macros to keep the namespace clear, but you can fill the namespace with whatever you want.