GeneralCreating logarithm tables automatically

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Creating logarithm tables automatically

Post by dmuthu_cse »

Hello friends,

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Creating logarithm tables automatically

Post by gmedina »

Hi, Muthu

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}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Re: Creating logarithm tables automatically

Post by dmuthu_cse »

Thanks Gmedina for quick help.

It is much useful to me.

Regards,
Muthu
Post Reply