Skip to content

ConstantNode - intended values. #2823

Answered by gwhitney
JacobBeaudry asked this question in Q&A
Discussion options

You must be logged in to vote
  1. the typescript typing of the ConstantNode constructor may well be too restrictive, and if mathjs is indeed creating ConstantNode objects with, say, string values, then I don't see any reason you shouldn't submit a PR widening the typescript type and adding tests for the wider type.

  2. The question of the proper parse for the string -2 is more subtle: is that the unary minus operator applied to the constant two or the constant "negative two"? I gather mathjs currently prefers the former. That's one of those changes that it's hard to know the ramifications of: maybe someone else is depending on all - symbols being captured as operator nodes... so my recommendation would be to just run a cu…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JacobBeaudry
Comment options

@josdejong
Comment options

Answer selected by JacobBeaudry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants