My first two-view test worked after refreshing the page, although Preview had shown the source text. That made me wonder: could a few clicks help me separate what I see, what is stored, and the exact mathematical quantity?
Here is the fuller experiment. Click each expression repeatedly; after the last view it returns to the first. If the source text appears, try refreshing the page. No Stata installation is needed to view these recorded values. Clicking changes the display; it does not run Stata or Mata.
A. Pi: exact target and stored approximations
\[
\require{action}
\toggle
{\text{Exact target (click): }\pi}
{\text{Stored double: }\frac{884279719003555}{281474976710656}}
{\text{Double displayed: }3.14159265358979312}
{\text{Stored float: }\frac{13176795}{4194304}}
{\text{Float displayed: }3.14159274101257324}
\endtoggle
\]
The double value is shared by Stata's _pi and Mata's pi(). The fractions describe the stored values exactly; the 17-place decimal displays are rounded. Changing the card does not convert one stored value into another.
B. The sine of pi: an identity, a calculation, and a display
\[
\toggle
{\text{Identity (click): }\sin(\pi)=0}
{\text{Recorded result: }\sin(p)\approx1.224646799\times10^{-16}}
{\text{Six decimal places: }0.000000}
{\text{Exact equality to zero: false}}
{\text{Absolute value below }10^{-12}\text{: true}}
\endtoggle
\]
Here p is the stored double approximation to pi in A. The sine result was recorded in Stata/MP 16.1; its final digits may depend on the platform. The exact identity uses mathematical pi, not p. The tolerance is a choice for this example.
C. A deliberately false equation
\[ 1+1=3 \]
Will this also look like a perfectly respectable equation? I expect it to: typesetting a formula does not check its truth or run the expression.
I would be interested to hear whether these longer cards also work on other browsers or touch screens. If the interaction does not work, the plain-text reference below still gives the contents.
MathJax action extension:
https://docs.mathjax.org/en/latest/i...ns/action.html
Here is the fuller experiment. Click each expression repeatedly; after the last view it returns to the first. If the source text appears, try refreshing the page. No Stata installation is needed to view these recorded values. Clicking changes the display; it does not run Stata or Mata.
A. Pi: exact target and stored approximations
\[
\require{action}
\toggle
{\text{Exact target (click): }\pi}
{\text{Stored double: }\frac{884279719003555}{281474976710656}}
{\text{Double displayed: }3.14159265358979312}
{\text{Stored float: }\frac{13176795}{4194304}}
{\text{Float displayed: }3.14159274101257324}
\endtoggle
\]
The double value is shared by Stata's _pi and Mata's pi(). The fractions describe the stored values exactly; the 17-place decimal displays are rounded. Changing the card does not convert one stored value into another.
B. The sine of pi: an identity, a calculation, and a display
\[
\toggle
{\text{Identity (click): }\sin(\pi)=0}
{\text{Recorded result: }\sin(p)\approx1.224646799\times10^{-16}}
{\text{Six decimal places: }0.000000}
{\text{Exact equality to zero: false}}
{\text{Absolute value below }10^{-12}\text{: true}}
\endtoggle
\]
Here p is the stored double approximation to pi in A. The sine result was recorded in Stata/MP 16.1; its final digits may depend on the platform. The exact identity uses mathematical pi, not p. The tolerance is a choice for this example.
C. A deliberately false equation
\[ 1+1=3 \]
Will this also look like a perfectly respectable equation? I expect it to: typesetting a formula does not check its truth or run the expression.
I would be interested to hear whether these longer cards also work on other browsers or touch screens. If the interaction does not work, the plain-text reference below still gives the contents.
Code:
Exact target: pi Stored double = 884279719003555 / 281474976710656 17-place display: 3.14159265358979312 Stored float = 13176795 / 4194304 17-place display: 3.14159274101257324 Mathematical sin(pi) = 0 Recorded sin(p) approximately 1.224646799e-16 Same result displayed to six places: 0.000000 sin(p)==0: false abs(sin(p))<1e-12: true
https://docs.mathjax.org/en/latest/i...ns/action.html

Comment