add a promote to the SigFig macro to handle other expressions#28
add a promote to the SigFig macro to handle other expressions#28
Conversation
Fix issues noted in my review of openwebwork#1266.
|
I approve this PR. For #27, there is a problem. Since you removed all the operators, that means you removed unary minus, so you can't produce any negative numbers. One solution would be to make the number pattern include the optional leading negative sign. The drawback to that is that if someone entered something like The other solution would be to allow unary minus and override it to check that it only applies to a (positive) Real. You might also want to remove parentheses as well, in order to avoid For #30, I have been thinking about a new possibility that would handle the situation better. It would allow I've been experimenting with the needed updates (it is a bit complicated), and should be able to fold in the negative number issue for the strict context. I'll let you know when I have something to share. |
As noted in #25 (comment) @dpvc noted that if SigFigs are passed to subroutines that have non-sigfig numbers that those other numbers will be promoted to sig figs. In general, this is not what is wanted (see the average function in the link above.)
This adds a promote to the SignificantFigures::Real package that will promote non-sig fig numbers to have infinite sig figs.