GeezerVison is showing github.com — Evaluate bug with coulomb but not C or coulombs · Issue #3472 · josdejong/mathjs
Evaluate bug with coulomb but not C or coulombs #3472
Description
Something is wrong with the evaluation of "coulomb" but "C" and "coulombs" both appear to be working.
> math.evaluate("coulomb").toString()
< "8.987551792261171e+9 (N m^2) / C^2"
> math.evaluate("C").toString()
< "C"
> math.evaluate("coulombs").toString()
< "coulombs"Activity
costerwi commented on May 16, 2025
ContributorAuthor
More actions
Got it: coulomb is defined in the code as both a unit and a physical constant.
Maybe we could capitalize the Coulomb constant or rename to coulombConstant as seems to be the convention for other physical constants in the code.
josdejong commented on May 21, 2025
I like renaming the constant into coulombConstant.
Though we cannot use the constant like math.evaluate('coulomb'), we can use it like math.coulomb. So, to prevent introducing a breaking change I think we should keep both constants coulomb and coulombConstant for the time being (and mark the first as deprecated and don't use it anymore in the docs).
Would you be able to create a PR to fix this Carl?
added a commit that references this issue
on May 28, 2025This issue will close once commit 123d4aa is merged into the 'develop' branch.123d4aa josdejong commented on May 28, 2025
I've created coulombConstant in 123d4aa and published the fix in v14.5.1.
costerwi commented on May 28, 2025
ContributorAuthor
More actions
bornova commented on May 28, 2025
Would it be possible to add back the help docs for coulomb until deprecated?
math.help('coulomb').doc.description // Uncaught Error: No documentation found on "coulomb"
In my app, I filter the math object to get all available constants and add a tooltip to each constant using their help docs. Now it throws an error because the coulomb constant still exists but doesn't have docs. I can handle the error manually but would be nice to keep the doc.
josdejong commented on May 29, 2025
That's fine with me, addressed via 9431418 (not yet published).
josdejong commented on May 30, 2025
The docs for the deprecated physical constant coulomb are published now in v14.5.2.
Metadata
Metadata
Development
No branches or pull requestsIssue actions