DigitsTolType

From WeBWorK_wiki
Revision as of 17:31, 28 April 2021 by Pstaabp (talk | contribs)
Jump to navigation Jump to search
Construction.png This article is under construction. Use the information herein with caution until this message is removed.

Digits TolType


This describes an alternative way for determining the tolerance type based on the number of digits.

Problem Techniques Index

PG problem file Explanation
DOCUMENT();
loadMacros(
  "PGstandard.pl",
  "MathObjects.pl",
  "PGML.pl"
);
TEXT(beginproblem());

Initialization: This is built-in to MathObjects.

Context("Numeric")->flags->set(tolType=>'digits',tolDigits => 3, tolerateTruncation=>0);

Setup:

  • The
    tolType=>'digits'
    switch to the digits tolerance.
  • The
    tolDigits=>3
    sets the number of digits to 3 (the default)
  • The
    tolerateTruncation
    parameter is either 1 (true) or 0 (false).

BEGIN_PGML
Graph the circle given by the following equation.

	[`[$circle_eq_lhs] = [$r ** 2]`]

[_]{$gt}
END_PGML

Main Text: This asks to graph the circle given by the equation. And the code:

[_]{$gt}

inserts the GraphTool.

BEGIN_PGML_SOLUTION
The equation of the circle of the form:

[`[$circle_eq_lhs] = [$r ** 2]`]

has a center at [`([$h],[$k])`] and radius [$r].   To enter the graph, click the circle tool, then click the center at [`([$h],[$k])`] and then click a second point that is [$r] units from the center.  This is easist going left, right, up or down from the center.
END_PGML_SOLUTION

ENDDOCUMENT();

This is the solution.

Problem Techniques Index


  • POD documentation: [1]