bigfloat

dsimcha dsimcha at yahoo.com
Wed Apr 8 12:18:32 PDT 2009


== Quote from Paul D. Anderson (paul.d.removethis.anderson at comcast.andthis.net)'s
article
> Is there an active project to develop arbitrary-precision floating point numbers
for D?
> I've got a little extra time at the moment and would like to contribute if I
can. I've done some work in floating point arithmetic and would be willing to
start/complete/add to/test/design/etc. such a project. What I hope NOT to do is to
re-implement someone else's perfectly adequate code.
> If no such project exists I'd like to start one. If there are a bunch of
half-finished attempts (I have one of those), let's pool our efforts.
> I know several contributors here have a strong interest and/or background in
numerics. I'd like to hear inputs regarding:
> a) the merits (or lack) of having an arbitrary-precision floating point type
> b) the features and functions that should be included.
> Just to be clear -- I'm talking about a library addition here, not a change in
the language.
> Paul

Absolutely, I would love having a BigFloat in D, especially if it were in Phobos
and thus worked straight out of the box and had a good API (should be relatively
easy to make a good API with all the new language features geared toward lib
writers that have been added lately).

In addition to the obvious uses for BigFloat, here's a not so obvious one:  You're
writing some kind of quick and dirty numerics simulation that only has to run a
few times.  You know of a really simple, elegant algorithm for your problem,
except that it's numerically unstable.  You do not want to spend the time to
implement a more complicated algorithm because it's just not worth it given the
computer time-programmer time tradeoff in question.  Solution:  Use a BigFloat and
be done with it.  (Flame guard up:  No, I don't recommend this for any production
numerics algorithms, but who the heck doesn't sometimes write bad code focused on
ease of implementation if it's just a one-off thing?)



More information about the Digitalmars-d mailing list