Skip to content

Conversation

abloomston
Copy link

This proposed fix for #388 involves actually including math.js.

Advantages:

  • Relying directly on math.js, a well-tested and well-maintained library
  • Further use of floating point arithmetic can easily make use of math.js

Disadvantages:

  • Huge increase (4-7x) in jsoneditor.js and jsoneditor.min.js file size
  • More complicated build process

* bower and grunt-bower-concat are now required for building json-editor
* math.js is now required for running json-editor, but is not checked by jshint
* grunt no longer runs jshint on the output dist file, as it may contain
  external libaries
* float comparisons for multipleOf, divisibleBy, maximum, minimum use
  math.js
@jdorn
Copy link
Owner

jdorn commented Jul 3, 2015

What about treating math.js as an optional dependency? In the validator, use math.js if it's loaded on the page, otherwise use the existing logic.

@abloomston
Copy link
Author

@jdorn heads up I'm actually looking at this PR again right now, since the change fails for 3.57 multipleOf 0.01

This takes care of e.g. `3.57 multipleOf 0.01`.
@abloomston
Copy link
Author

Modified to now work for 3.57 multipleOf 0.01. I closed PR #437, and will investigate making math.js an optional dependency for this PR.

@jdorn jdorn closed this in b019e3b Feb 11, 2016
jdorn added a commit that referenced this pull request Feb 11, 2016
Closes #526 Closes #533 Closes #436 Fixes #388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants