examples/TrigTable.tex in erbtex-0.3.0 vs examples/TrigTable.tex in erbtex-0.4.1
- old
+ new
@@ -54,14 +54,14 @@
## the table, taking care to use ruby's BigDecimal class to ensure
## accuracy. The table is set up here to go from 0 to pi/2 in
## increments of step
require 'bigdecimal'
- step = BigDecimal.new("0.001")
+ step = BigDecimal("0.001")
one = BigDecimal("1.0")
z0 = BigDecimal("0.0")
- p2 = BigDecimal.new((Math::PI / 2.0).to_s)
+ p2 = BigDecimal((Math::PI / 2.0).to_s)
-:}
%% Treat the first line of the table, for an x value of 0 specially
%% by giving exact answers in symbolic form.
{:= "\\multicolumn{1}{c|}{{\\mathversion{bold}\\mark{0}$0$}}" :}&
@@ -74,14 +74,14 @@
%% Here is the loop for the body of the table, which starts with
%% x one step beyond 0 and pre-computes some of the functions
{: x = z0 + step
while (x < p2) do
- tanx = BigDecimal.new(Math.tan(x).to_s)
- cotx = one / BigDecimal.new(Math.tan(x).to_s)
- secx = one / BigDecimal.new(Math.cos(x).to_s)
- cscx = one / BigDecimal.new(Math.sin(x).to_s)
+ tanx = BigDecimal(Math.tan(x).to_s)
+ cotx = one / BigDecimal(Math.tan(x).to_s)
+ secx = one / BigDecimal(Math.cos(x).to_s)
+ cscx = one / BigDecimal(Math.sin(x).to_s)
:}
{:
## Here is where each line of the main body of the table is set.
## We use the digs function defined above to make sure that every
@@ -120,6 +120,6 @@
{:= "\\multicolumn{1}{c}{$\\infty$}" :}&
{:= "\\multicolumn{1}{c}{$1$}" :}\\
%% End the table and document---this version comes to 315 pages!
\end{longtable}
-\end{document}
+\end{document}
\ No newline at end of file