// Numbas version: finer_feedback_settings {"name": "Round a number to \\(n\\) significant figures", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Round a number to \\(n\\) significant figures", "tags": [], "metadata": {"description": "
Round a number to $n$ significant figures. Part of HELM Book 1.1
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "Round $\\var{n}$ to $\\var{d}$ significant figures:
", "advice": "To round to $\\var{d}$ decimal places we look at the $\\var{d+1}$ $^{nd}$$^{rd}$ $^{th}$ digit in $\\var{n}$.
\nThis is $\\var{td}$
\n$\\var{td}$ $< 5$ $>= 5$ so we round down up to get $\\var{siground(n,d)}$
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"d": {"name": "d", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "precround(random(-50..50 #0.00000001),random(4..7))", "description": "", "templateType": "anything", "can_override": false}, "td": {"name": "td", "group": "Ungrouped variables", "definition": "switch(abs(n) >= 10, trunc(abs((n-trunc(n,d-2))),d-1)*10^(d-1), abs(n) >=1, trunc(abs((n-trunc(n,d-1))),d)*10^(d), trunc(abs((n-trunc(n,d))),d+1)*10^(d+1))", "description": "the test digit
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["d", "n", "td"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "siground(n,d)", "maxValue": "siground(n,d)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}