Re: Conformance
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Sat, 09 Feb 2008 18:31:54 +0100
Charlie Gordon wrote:
You mention double double elsethread: are they 128 floats as specified by IEEE ?
No, I use two 64 bit doubles as in the package of Bailey.
They give a precision of approx 30 decimal digits
Regarding 352 bit floats: where did you get specs for those ?
From S. Moshier, its cephes math library.
I rewrote all the basic stuff (the four operations) in
assembler (32 and 64 bit) and modified many routines
to achieve full 105 digit precision.
All the C library has been written in that precision.
How many bits of mantissa and exponent ?
#define _NQ_ 12
typedef struct qfloatstruct {
int sign;
int exponent;
unsigned int mantissa[_NQ_]; // 32 bit integers
}qfloat;
any padding involved ?Yes
how much is sizeof(qfloat) ?See above
Did you implement the full math.h library for those or just the basic operations ?
Full math.h
Can you use them as components of complex numbers ?Yes
Is garbage collection necessary for them ?NO
Do you have a syntax for constant literals ?
#include <qfloat.h>
// INPUT
qfloat s = 3.1415965358979323846264338327950288419Q;
// OUTPUT
printf("%110.104qf\n",s);
Do you then have a syntax for specifying syntax extensions for constant literals ?
This is a point that is still not yet in my proposal.
As in C++, you can do this NOW by doing
Mynewtype m = "3.141593.1415965358979323846264338327950288419";
because you overload the assignment operator:
Mynewtype operator=(Mynewtype &a,char *someString);
Note the reference operator.
This is not optimal, since you can't do this at the global level
(the same problem as in C++)
I am developing a new solution, where you can specify a function that
is called AT COMPILE TIME when the compiler finds an unknown number
type.
This is much more powerful, and would solve all problems associated with
initialization and simplification.
Note that simplifying expressions with this new types of numbers is NOT
possible in C++. This would be possible if the compiler can call a
simplification procedure, giving it some expression and compiling the
result.
What is very inetersting is that we can use the experience gained in
C++ to prroduce a compatible software but with added functionality.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.
- Follow-Ups:
- Re: Conformance
- From: Francis Glassborow
- Re: Conformance
- From: Ian Collins
- Re: Conformance
- From: Charlie Gordon
- Re: Conformance
- From: Ben Bacarisse
- Re: Conformance
- References:
- Re: Conformance
- From: James Kuyper
- Re: Conformance
- From: jacob navia
- Re: Conformance
- From: jameskuyper
- Re: Conformance
- From: jacob navia
- Re: Conformance
- From: Douglas A. Gwyn
- Re: Conformance
- From: James Kuyper
- Re: Conformance
- From: Douglas A. Gwyn
- Re: Conformance
- From: Francis Glassborow
- Re: Conformance
- From: Douglas A. Gwyn
- Re: Conformance
- From: jacob navia
- Re: Conformance
- From: Charlie Gordon
- Re: Conformance
- Prev by Date: Re: Conformance
- Next by Date: Re: Updated version of "The New C Standard" book available
- Previous by thread: Re: Conformance
- Next by thread: Re: Conformance
- Index(es):
Relevant Pages
|