LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Wed, 16 Jun 2010 08:08:11 +0100
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
From:
Joseph Wright <[log in to unmask]>
Parts/Attachments:
text/plain (31 lines)
On 16/06/2010 01:48, peter wilson wrote:
> At one point, many tears (a Freudian slip --- I meant to write `years')
> ago, I needed to manipulate large numbers within LaTeX and wrote a
> package to do so. I never released it and it has gone the way of several
> computer upgrades. In any case, it handled mantissas in the range 0 --
> 1,000,000,000 with exponents in the range of +/- 0 -- 1,000,000,000.
> Would you consider extending your basic l3fp module to include
> exponents, perhaps, if necessary by being able to switch between the
> current 18 significant digits to 9 significant digits + exponent.
>
> Peter W.

My first plan had been to do everything internally in exponent form, but 
I realised it would be very inefficient for the large number of cases 
where it was not needed. Thinking about it some more, I wonder about the 
following:

  - Input without exponent: calculate as currently, and shift result to 
exponent form if there is an overflow.
  - Input in exponent form: calculate with exponents, shift result 
either to appropriate exponent form or drop exponent if not needed.

That should still be reasonably fast (there are just a few extra checks 
for input which is not exponent-containing), and I think not too hard to 
do. Certainly not as hard as working out how to do sin, cos, etc. (I'm 
currently reading about the CORDIC method for this: probably need to do 
some speed tests. The fp package does not explain the algorithm it uses, 
so I may have to work it all out by hand.)
--
Joseph Wrigh

ATOM RSS1 RSS2