Sig fig context#1474
Open
pstaabp wants to merge 19 commits into
Open
Conversation
This includes flags for determining if a problem is to check to see if an answer has the correct # of sig figs and/or is close and give partial credit.
when using the extension with Units context and added a test for units with significant figures.
Also fixed an issue with the testing for "closeness" between student and correct sigfig answers.
Also, some improvements to language on tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This creates a context for Significant Figures and huge thanks to @dpvc for all the help and @sfiedle1 for ideas, code and other suggestions.
In short, this handles the creation of a number type that keeps track of the number of its significant figures. Although the number is stored as a floating point, the
stringmethod rounds to the appropriate number of significant figures.Here are a few features:
1.23^3to result in an expected number with 3 sigfigs instead of 1, since 3 only has 1 sig fig.LimitedSignificantFigurescontext which disallows computations similar to other contexts.contextExtensions.plmacro, problems using both SignificantFigures and Units can be used together.There are two test suites.
significant_figures.ttests only numbers and operations between numbers.significant_figures_units.tincludes some simple tests for numbers with units.I have attached 4 sample problems.
setsig_fig.zip
If we can get this into 2.21, that would be great. It doesn't affect anything else. If not, I'll retarget to develop.
Also, for historical purposes, there is other discussion: pstaabp/pull/25 pstaabp/pull/32, pstaabp/pull/34 and pstaabp/pull/36