Skip to content

Commit

Permalink
bug on random/math_random removed (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-henz authored Dec 13, 2021
1 parent 632a179 commit c789a2c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion javascript/latexContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const title = `\\begin{titlepage}
\\pagestyle{chapter-open}
`;

export const preamble = `\\documentclass[nocrop,7x10]{../mitpress/mit}
export const preamble = `\\documentclass[7x10]{../mitpress/mit}
% use: option nocrop to remove cropmarks
% also remember: hyperref in mitpress/mit.cls: switch to black/black/black (line 1851)
%
Expand Down
20 changes: 13 additions & 7 deletions xml/chapter3/section1/subsection2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -539,16 +539,22 @@ function random_gcd_test(trials, initial_x) {
<SCHEME>procedure</SCHEME>
<JAVASCRIPT>function</JAVASCRIPT>
</SPLITINLINE>
implements this in terms of the <SCHEMEINLINE>random</SCHEMEINLINE>
implements this in terms of the
<SPLITINLINE>
<SCHEME>procedure</SCHEME>
<JAVASCRIPT>function</JAVASCRIPT>
<SCHEME>
<SCHEMEINLINE>random</SCHEMEINLINE>
procedure
</SCHEME>
<JAVASCRIPT>
<JAVASCRIPTINLINE>math_random</JAVASCRIPTINLINE>
function
</JAVASCRIPT>
</SPLITINLINE>
used in section<SPACE/><REF NAME="sec:primality"/>, which returns a
nonnegative number less than its
nonnegative number less
<SPLITINLINE>
<SCHEME>
input.<FOOTNOTE>
than its input.<FOOTNOTE>
MIT Scheme
<INDEX>MIT Scheme<SUBINDEX><ORDER>random</ORDER><SCHEMEINLINE>random</SCHEMEINLINE></SUBINDEX></INDEX>
provides such a
Expand All @@ -565,7 +571,7 @@ function random_gcd_test(trials, initial_x) {
decimal value.</FOOTNOTE>
</SCHEME>
<JAVASCRIPT>
input.
than<SPACE/>1.
</JAVASCRIPT>
</SPLITINLINE>
<SNIPPET POSTPADDING="no">
Expand All @@ -581,7 +587,7 @@ function random_gcd_test(trials, initial_x) {
<JAVASCRIPT>
function random_in_range(low, high) {
const range = high - low;
return low + random(range);
return low + math_random() * range;
}
</JAVASCRIPT>
</SNIPPET>
Expand Down

0 comments on commit c789a2c

Please sign in to comment.