Re: bignum with floating point
- From: rem642b@xxxxxxxxx (Robert Maas, see http://tinyurl.com/uh3t)
- Date: Mon, 21 May 2007 11:59:42 -0700
From: banan...@xxxxxxxxxxxx
I want to program a bignum library in C just for learning, it
doesn't seem too hard (I don't care about speed) when considering
just integer numbers, but when I add support for division and
need floating point numbers I doesn't look so easy anymore. I
wonder if it's hard to do this. Is there some easy trick to do
this? Can I just round off some fixed digits to the right of the
decimal-point? Or do I need to get a deep understanding of
floating point representations and IEEE standards?
Floating point arithmetic, and rounding, is for people who are too
lazy to keep careful track of error tolerances throughout their
calculations and too stupid to use interval arithmetic to do all
that error-tracking fully automatically.
I personally recommend you don't even touch that crap. Instead,
write a decent interval-arithmetic package that supports
"scientific" notation, i.e. normalized value times arbitrary power
of 2 or 10 or 16. It'll be a bit more work to do it right instead
of sloppy, but it'll pay back the first time you write a
significant numerical application that uses your library.
.
- Follow-Ups:
- Re: bignum with floating point
- From: user923005
- Re: bignum with floating point
- Prev by Date: Re: Finding prime number < N in O(1) time
- Next by Date: Re: bignum with floating point
- Previous by thread: Re: bignum with floating point
- Next by thread: Re: bignum with floating point
- Index(es):
Relevant Pages
|