Re: increased machine precision for FreeBSD apps?
From: David Schultz (das_at_FreeBSD.ORG)
Date: 07/15/04
- Previous message: Poul-Henning Kamp: "Re: newbus integration of MOD_QUIESCE"
- In reply to: Jay Sern Liew: "increased machine precision for FreeBSD apps?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 15 Jul 2004 08:39:20 -0700 To: Jay Sern Liew <liew@jaysern.org>
On Sun, Jul 11, 2004, Jay Sern Liew wrote:
> This is probably more of an organizational issue than an architectural
> one. In the event of running applications with heavy floating point
> arithmetic (e.g. scientific computation apps for one, encryption
> algorithms, compression, .. etc ), would it be a good idea to decrease
> rounding errors by increasing the data type size?
Most programmers expect a float to be an IEEE 754 single-precision
number, and they expect a double to be a double-precision number.
On most modern FPUs, however, floats, doubles, and sometimes even
long doubles take about the same number of clock cycles. The only
good reason to use float is for things like genomics, where you're
doing calculations on gigabytes of data, and the goal is to fit as
much of it in memory as possible.
So here's how you handle the problem. If you want to use the
largest type that's at least as big as a float, use C99's float_t
instead. If you want the largest type that's at least as big as a
double, use double_t. If you want the largest type possible, at
the expense of having to emulate it on architectures such as
PowerPC, use long double. If you want to run one of those
scientific apps that phk says don't exist, use an
arbitrary-precision arithmetic package such as Gnu MP, Paul
Rouse's public domain clone thereof, QLIB, or Mathematica.
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Poul-Henning Kamp: "Re: newbus integration of MOD_QUIESCE"
- In reply to: Jay Sern Liew: "increased machine precision for FreeBSD apps?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: why float
... A double *is* a float with more precision. ... It is possibly to do with spurious
precision in the doubles - in numerical ... I think it depends on teh algorithm
as well. ... single-precision in order to stop rounding errors from amplifying ...
(microsoft.public.dotnet.languages.csharp) - Re: HPGCC related ...
... your suggestion about using the stack library. ... I am currently entering my
variables as strings. ... having problems to display floats or doubles on screen.
... to print a float: ... (comp.sys.hp48) - Re: doubles or not
... > even a float can not be enough for this, we may need doubles. ...
the point that you are missing is "..when integers will do". ... integer math. ...
(microsoft.public.vc.language) - Re: 80 bit precision ?
... > Last I read, in CPython, the float type encapsulates a C double. ... does
any C compiler implements doubles as 80 bit floats? ... (comp.lang.python)