Related problem
We currently have math eval that takes a string and parses and executes math in it through the meval crate.
This creates two sources of truth how math behaves in nushell.
Further more the crate carries some out of date dependencies, causing dependency duplication.
Describe the solution you'd like
For nu to be a fully useable scripting language there should be a library of math functions that are implemented with proper care (may be part of the core or a plugin).
math eval shouldn't be necessary or trivially implementable in nu code.
Describe alternatives you've considered
Hot take: If you need string math bc is still around, but math eval is only slightly more compatible with nushell/
List of missing math commands:
Compare to https://docs.rs/meval/latest/meval/#supported-expressions
Exponentiation
Trigonometry
Utilities
constants:
Related problem
We currently have
math evalthat takes a string and parses and executes math in it through themevalcrate.This creates two sources of truth how math behaves in nushell.
Further more the crate carries some out of date dependencies, causing dependency duplication.
Describe the solution you'd like
For nu to be a fully useable scripting language there should be a library of math functions that are implemented with proper care (may be part of the core or a plugin).
math evalshouldn't be necessary or trivially implementable in nu code.Describe alternatives you've considered
Hot take: If you need string math
bcis still around, butmath evalis only slightly more compatible with nushell/List of missing math commands:
Compare to https://docs.rs/meval/latest/meval/#supported-expressions
Exponentiation
pow/ general exponentiationexp,lnTrigonometry
sincostanasinacosatanatan2sinhcoshtanhasinhacoshatanhUtilities
signum(get the sign cheaply)moduloconstants:
pie