Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proposed fix 1/2 for #388 #436

Closed
wants to merge 2 commits into from
Closed

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants