
C++ For Mathematicians (2006) [eng]
.pdf
486 |
C++ for Mathematicians |
|
|
PHI = 1.61803 |
|
|
|
|
TeX form: \frac{\left(1 + \sqrt{5}\right)}{2} |
|
|||
|
(1+√ |
|
|
|
|
|
) . |
||
The T X code produces this: |
5 |
|||
E |
2 |
|
|
|
Showing that two Constructible objects represent the same complex number is tricky so we did not define an == operator. See E.R. Scheinerman, “When close enough is close enough,” American Mathematical Monthly 107 no. 6 (June–July 2000) 489–499 for one approach.
15.6A full solution is available on the accompanying CD-ROM. In this solution we use several classes.
–Token: Objects of this type are “atoms” of a Boolean expression. This may be a variable, a constant, a unary operation, or a binary operation.
–Expression: Objects of this type represent Boolean expressions.
–LookupTable: These are devices that associate Boolean values with variables.
–ExpressionLoader: This is a device to read input streams and produce
Expression objects.
–TautologyChecker: This is a device that runs through all possible substitutions for the variables in an Expression to see if any yield FALSE. If not, then the expression is a tautology.








