General ⇒ Creating logarithm tables automatically
-
- Posts: 97
- Joined: Fri Sep 04, 2009 4:56 pm
Creating logarithm tables automatically
I need to create logirthm and antilogrithm tables. And is there any code to generate the logirthm and antilogrithm table automatically.
Expecting your suggestions and solutions.
Regards,
Muthu
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Creating logarithm tables automatically
you could use the fp package (for floating point operations) and a loop (using the ifthen or multido packages, for example). A little example that calculates the natural logarithm of integer values 1<=t<=1000:
Code: Select all
\documentclass{article}
\usepackage{fp}
\usepackage{ifthen}
\setlength\parindent{0pt}
% the counter for the loop
\newcounter{mycount}
% the command that stores logarithms
\newcommand\natlogoft
\begin{document}
\whiledo{\value{mycount}<1000}
{\stepcounter{mycount}\makebox[4em]{\themycount}% steps the counter and typesets the value of t
\FPln{\natlogoft}{\themycount}\natlogoft\\}% calculates Ln(t) and typsets it
\end{document}
-
- Posts: 97
- Joined: Fri Sep 04, 2009 4:56 pm
Re: Creating logarithm tables automatically
It is much useful to me.
Regards,
Muthu