Is there a bigger, mathematical, data type in C than the double (64 bit) one
or the old long double (80 bit)?
I'd like to add precision to my mathematical application, but I can't figure
out how.
Thanks alot. 33 7358
>Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits.
long double is not guaranteed to be 80 bits, and why is it the *OLD*
long double?
Do you have floatingpoint hardware that uses more than 80 bits
to represent a number?
I'd like to add precision to my mathematical application, but I can't figure out how.
An int could conceivably be 128 bits, although if your machine has
128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
"Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio
news:co********@library1.airnews.net... Is there a bigger, mathematical, data type in C than the double (64 bit)
oneor the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number?
I'd like to add precision to my mathematical application, but I can't
figureout how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme;
I would like to add decimals to my results example instead of
17 decimals 30 or 40.
Daniel Fadlun wrote: "Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...
Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number?
I'd like to add precision to my mathematical application, but I can't figure out how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
That's 100133 significand bits. Hformat numbers on
the VAX could approach the lower end (I don't recall just
how many of its 128 bits were exponent), but I'm not aware
of any C compiler that made use of Hformat.
The big question, though, is why do you want so many
digits? What meaning could you assign to a plusorminus
one fluctuation in the fortieth decimal place? If you're
trying to calculate the radius of the Universe in Angstrom
units, forty places are far more than you need.
 Er*********@sun.com
Eric Sosman wrote: Daniel Fadlun wrote:
"Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...
Is there a bigger, mathematical, data type in C than the double (64 bit)
one
or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number? I'd like to add precision to my mathematical application, but I can't
figure
out how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
That's 100133 significand bits. Hformat numbers on the VAX could approach the lower end (I don't recall just how many of its 128 bits were exponent), but I'm not aware of any C compiler that made use of Hformat.
The big question, though, is why do you want so many digits? What meaning could you assign to a plusorminus one fluctuation in the fortieth decimal place? If you're trying to calculate the radius of the Universe in Angstrom units, forty places are far more than you need.
I'll be sorry I did this but..
angstrom
n : a metric unit of length equal to one ten billionth of a
meter (or 0.0001 micron); used to specify wavelengths of
electromagnetic radiation [syn: angstrom unit, A]
...and so 1 meter is 10,000,000,000 angstroms.
The speed of Light is 300 million meters per second. In angstroms we
have 1e10 * 3e8. That would bring us to 3e18 or
3,000,000,000,000,000,000
angstroms per second Light speed. That's only 19 digits but it's
only one second. I'm not sure the 'correct' seconds per year but 60
* 60 * 24 * 365.25 yields 31,557,600 seconds. One Light Year would
be about 9.46728e25 angstroms. Let's say 1e26 angstroms.
Ah now, what is the radius of the Universe? Even if we thought it
could be 10 billion Light Years that would be 1e10 and would be only
1e36 angstroms. Eric is right. 40 digits will be enough.
How many digits can a 128bit int represent? 40?
I'm right after all. I'm sorry I did this. ;)

Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
 Albert Einstein 
"Daniel Fadlun" <mu**********@fastwebnet.it> wrote in message news:<pF*****************@tornado.fastwebnet.it>.. . "Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...Is there a bigger, mathematical, data type in C than the double (64 bit) oneor the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number?
I'd like to add precision to my mathematical application, but I can't figureout how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
Do you know how to implement big big number addition/subtraction etc
using arrays/linked lists(yes, you do the operations by hand).You can
try the
same for figures following the decimal point.So conceptually you will
be adding elements of two arrays.You just keep an index as to where to
put the decimal point while printing.
If you are through with this, or this is way too inefficent, think how
you can
use the array element to hold more than one integer (as in 1 of 3.21).
HTH
Suman.
Daniel Fadlun wrote: Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how. Thanks alot.
With lccwin32 you can use the qfloat data type with 350 bits and
approx 100 digits precision.
You use just as the other data types:
qfloat m = 23.3;
qfloat p = exp(m,6.0);
etc
lccwin32: http://www.cs.virginia.edu/~lccwin32
"Joe Wright" <jo********@comcast.net> wrote in message
news:Pp********************@comcast.com... Eric Sosman wrote: Daniel Fadlun wrote:
"Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...
>Is there a bigger, mathematical, data type in C than the double (64 >bit)
one
>or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number? >I'd like to add precision to my mathematical application, but I can't
figure
>out how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
That's 100133 significand bits. Hformat numbers on the VAX could approach the lower end (I don't recall just how many of its 128 bits were exponent), but I'm not aware of any C compiler that made use of Hformat.
The big question, though, is why do you want so many digits? What meaning could you assign to a plusorminus one fluctuation in the fortieth decimal place? If you're trying to calculate the radius of the Universe in Angstrom units, forty places are far more than you need.
I'll be sorry I did this but..
angstrom n : a metric unit of length equal to one ten billionth of a meter (or 0.0001 micron); used to specify wavelengths of electromagnetic radiation [syn: angstrom unit, A]
..and so 1 meter is 10,000,000,000 angstroms.
The speed of Light is 300 million meters per second. In angstroms we have 1e10 * 3e8. That would bring us to 3e18 or
3,000,000,000,000,000,000
angstroms per second Light speed. That's only 19 digits but it's only one second. I'm not sure the 'correct' seconds per year but 60 * 60 * 24 * 365.25 yields 31,557,600 seconds. One Light Year would be about 9.46728e25 angstroms. Let's say 1e26 angstroms.
Ah now, what is the radius of the Universe? Even if we thought it could be 10 billion Light Years that would be 1e10 and would be only 1e36 angstroms. Eric is right. 40 digits will be enough.
How many digits can a 128bit int represent? 40?
I'm right after all. I'm sorry I did this. ;)
 Joe Wright mailto:jo********@comcast.net "Everything should be made as simple as possible, but not simpler."  Albert Einstein 
gud wrk n nice explanation.
Neo
On Tue, 23 Nov 2004 17:58:02 0500, Eric Sosman <er*********@sun.com>
wrote in comp.lang.c: Daniel Fadlun wrote: "Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...
Is there a bigger, mathematical, data type in C than the double (64 bit)
one
or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number?
I'd like to add precision to my mathematical application, but I can't
figure
out how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
That's 100133 significand bits. Hformat numbers on the VAX could approach the lower end (I don't recall just how many of its 128 bits were exponent), but I'm not aware of any C compiler that made use of Hformat.
The big question, though, is why do you want so many digits? What meaning could you assign to a plusorminus one fluctuation in the fortieth decimal place? If you're trying to calculate the radius of the Universe in Angstrom units, forty places are far more than you need.
Often the need for high precision is not for either the input data or
output results, but to minimize the inevitable rounding (and other)
errors in complex calculations.
But even for that purpose, 30 to 40 decimal places seems excessive.

Jack Klein
Home: http://JKTechnology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/Cfaq/top.html
comp.lang.c++ http://www.parashift.com/c++faqlite/
alt.comp.lang.learn.cc++ http://www.contrib.andrew.cmu.edu/~a...FAQacllc.html
"Joe Wright" <jo********@comcast.net> wrote in message
news:Pp********************@comcast.com... How many digits can a 128bit int represent? 40?
unsigned: floor(log10(2^n)) + 1
signed: floor(log10(2^(n1))) + 1
Assuming 2's complement is used. Which by the way poses the queston wether
or not 2's complement is mandated/required by the standard or merely by many
CPU's (i assume it's the latter, but the question is a real one *and*
topical)
In <5q********************************@4ax.com> Jack Klein <ja*******@spamcop.net> writes: Often the need for high precision is not for either the input data or output results, but to minimize the inevitable rounding (and other) errors in complex calculations.
And when this is the case, it is quite often due to an inappropriate
choice of the algorithm. If hardware support for 128 floats has never
been popular, it is because there is precious little *real* demand for
this kind of precision.
Dan

Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
In article <41**********************@news.wanadoo.fr>, ja***@jacob.remcomp.fr
says... Daniel Fadlun wrote: Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how. Thanks alot.
With lccwin32 you can use the qfloat data type with 350 bits and approx 100 digits precision.
You use just as the other data types:
qfloat m = 23.3;
qfloat p = exp(m,6.0);
etc
lccwin32: http://www.cs.virginia.edu/~lccwin32
Please stop posting unportable "my compiler only" solutions to problems in
c.l.c.
In article <41***********************@dreader16.news.xs4all.n l>,
dandelion <da*******@meadow.net> wrote: "Joe Wright" <jo********@comcast.net> wrote in message news:Pp********************@comcast.com...
How many digits can a 128bit int represent? 40? unsigned: floor(log10(2^n)) + 1 signed: floor(log10(2^(n1))) + 1
Assuming 2's complement is used.
....or any other sensible way of encoding values in binary form without
using some bits for parity checking or error correcting. Some sensible
forms will have both positive and negative representations for zero,
but otherwise they'll use all 2^n possible bit patterns to represent
different values.
Ten bits is slightly more than three digits (2^10=1024), so without
calculating any logarithms 3839 digits is a reasonable guess for
128bit binary.
Which by the way poses the queston wether or not 2's complement is mandated/required by the standard or merely by many CPU's (i assume it's the latter, but the question is a real one *and* topical)
Not required by the standard.
I believe C99 requires one of binary 2scomplement, binary 1scomplement,
or binary signmagnitude for signed integer types. I'm not sure what
C90 has to say on the subject.
dave

Dave Vandervies dj******@csclub.uwaterloo.ca
I've got [a 2port hub]. It's so tiny that you can't see where the two
patch leads plug into it, & it's linepowered...
Lionel in the scary devil monastery
dandelion wrote: "Joe Wright" <jo********@comcast.net> wrote in message news:Pp********************@comcast.com...
How many digits can a 128bit int represent? 40?
unsigned: floor(log10(2^n)) + 1 signed: floor(log10(2^(n1))) + 1
Assuming 2's complement is used. Which by the way poses the queston wether or not 2's complement is mandated/required by the standard or merely by many CPU's (i assume it's the latter, but the question is a real one *and* topical)
The Standard permits two's complement, ones' complement,
and signed magnitude representations for negative integers.
Oddly, it *requires* two's complement for exactwidth integer
types, if the implementation provides them.
 Er*********@sun.com
In <41**********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes: Daniel Fadlun wrote: Is there a bigger, mathematical, data type in C than the double (64 bit) one
^^^^ or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how. Thanks alot.
With lccwin32 you can use the qfloat data type with 350 bits and approx 100 digits precision.
What part of "in C" was too difficult for you to understand?
lccwin32 is not a C compiler and qfloat is not a C feature.
Your advice is about as topical as "get a VAX/VMS box, rewrite your
code in FORTRAN and use the REAL*16 data type".
Dan

Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
On 24 Nov 2004 17:18:11 GMT, Da*****@cern.ch (Dan Pop) wrote: In <41**********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes:
....With lccwin32 you can use the qfloat data type with 350 bits and approx 100 digits precision.
lccwin32 is not a C compiler and qfloat is not a C feature.
Qfloat seems a 'vendorspecific' feature that seems a reasonable thing
to point out, especially as lccwin32 is free.
Perhaps the OP's compiler has a similar extension. If portability is
not an issue, then go for it.
Otherwise there are BIGNUMtype libraries for arbitrary precision
arithmetic.
The answer to the OP's original question seems to be: No, nothing
beyond double/long double builtin to C. And the advice seems to be:
You don't need that much precision, which I would dispute.. Your advice is about as topical as "get a VAX/VMS box, rewrite your code in FORTRAN and use the REAL*16 data type".
That's a good idea. Why not float*16 (or C equivalent syntax) in C?
Bart C.
Bart wrote: On 24 Nov 2004 17:18:11 GMT, Da*****@cern.ch (Dan Pop) wrote:
In <41**********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes:
...
With lccwin32 you can use the qfloat data type with 350 bits and approx 100 digits precision.
lccwin32 is not a C compiler and qfloat is not a C feature.
Qfloat seems a 'vendorspecific' feature that seems a reasonable thing to point out, especially as lccwin32 is free.
Perhaps the OP's compiler has a similar extension. If portability is not an issue, then go for it.
Otherwise there are BIGNUMtype libraries for arbitrary precision arithmetic.
The answer to the OP's original question seems to be: No, nothing beyond double/long double builtin to C. And the advice seems to be: You don't need that much precision, which I would dispute..
Your advice is about as topical as "get a VAX/VMS box, rewrite your code in FORTRAN and use the REAL*16 data type".
That's a good idea. Why not float*16 (or C equivalent syntax) in C?
Bart C.
An example where the extra precision is needed is... printf
To *implement* printf without greater precision than long double
means that roundoff errors will creep in when processing the
"%lld" directive.
Most quality implementation of printf include a higher precision
module, see for instance the implementation of gcc.
lccwin32 uses the qfloat package internally when reading and writing
floating point. The extra time that this uses is justified by
the greater accuracy of the printouts.
On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun"
<mu**********@fastwebnet.it> wrote: Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how.
yes GMP.
Introduction to GNU MP
GNU MP is a portable library written in C for arbitrary precision
arithmetic on integers, rational numbers, and floatingpoint numbers.
It aims to provide the fastest possible arithmetic for all
applications that need higher precision than is directly supported by
the basic C types.
ftp.gnu.org/gnu/gmp
jacob navia wrote:
[snip: Discussion about the topicality of qfloat in lccwin32 and
the usefulness for the OP] An example where the extra precision is needed is... printf To *implement* printf without greater precision than long double means that roundoff errors will creep in when processing the "%lld" directive.
Most quality implementation of printf include a higher precision module, see for instance the implementation of gcc.
lccwin32 uses the qfloat package internally when reading and writing floating point. The extra time that this uses is justified by the greater accuracy of the printouts.
You got me there  what do you need long doubles for when you
want to print a signed long long int? I would have gone for an
efficient "itoa" variant but am aware that compiler builders
want the thing to be fast, and not necessarily conforming...
If there is a nice trick I would be very interested :)
Apart from that: How bad can the rounding error be when only
working with long doubles? As every binary fraction has a
finite decimal fraction representation, it should be
theoretically possible to print out with a certain
rounding behaviour and no deviation (maybe I am too naive
with respect to the cost).
Cheers
Michael

EMail: Mine is an /at/ gmx /dot/ de address.
Michael Mair wrote: jacob navia wrote:
You got me there  what do you need long doubles for when you want to print a signed long long int?
Jeeeeez.... Sorry about that. It should have been "%Ld" of course!!!
Excuse me. Apart from that: How bad can the rounding error be when only working with long doubles? As every binary fraction has a finite decimal fraction representation, it should be theoretically possible to print out with a certain rounding behaviour and no deviation (maybe I am too naive with respect to the cost).
The complications arise with subnormal numbers, i.e. numbers
just below the normalization threshold, typically the results
of underflow. Gcc (and lccwin32) can print those numbers with
great precision because of the extended precision module, where
the underflow is eliminated.
Other problems arise when trying to print the infamous *last*
digit accurately, because it must be rounded, and not truncated
as it would be staying with the given precision. sa*****@hetnet.nl wrote: On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun" <mu**********@fastwebnet.it> wrote:
Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how.
yes GMP.
Introduction to GNU MP
GNU MP is a portable library written in C for arbitrary precision arithmetic on integers, rational numbers, and floatingpoint numbers. It aims to provide the fastest possible arithmetic for all applications that need higher precision than is directly supported by the basic C types.
ftp.gnu.org/gnu/gmp
Nice package. It is approx twice as fast as lccwin32.
It doesn't really run under windows though, and even if I have heard of
unsupported ports, nothing really official exist for windows, as far as
I know.
Please correct me if I am wrong.
It is twice as fast because it uses a variable precision number system,
reducing the number of calculations to be done for small numbers.
Besides it has a lot of assembly in it, maybe one of the reasons there
isn't a windows version (besides the cygwin emulator)
C library support is not provided with the package, i.e. all the
functions of the C library aren't supported even if it has the most
important ones (sqrt, etc).
All in all, the best thing around.
jacob navia wrote: With lccwin32 you can use the qfloat data type with 350 bits and approx 100 digits precision.
You use just as the other data types:
qfloat m = 23.3;
qfloat p = exp(m,6.0);
Sorry that should have been
qfloat p = pow(m,6.0); etc
lccwin32: http://www.cs.virginia.edu/~lccwin32
In article <co**********@rumours.uwaterloo.ca>, dj******@csclub.uwaterloo.ca (Dave Vandervies) writes: In article <41***********************@dreader16.news.xs4all.n l>, dandelion <da*******@meadow.net> wrote: Which by the way poses the queston wether or not 2's complement is mandated/required by the standard or merely by many CPU's (i assume it's the latter, but the question is a real one *and* topical)
Not required by the standard.
I believe C99 requires one of binary 2scomplement, binary 1scomplement, or binary signmagnitude for signed integer types. I'm not sure what C90 has to say on the subject.
I asked about that a few years back, and the consensus was that the
requirements in C90  a "pure binary" number system and so forth  in
effect eliminated any other possibilities than the three you mention
above. BCD, for example, is out, because of the "pure binary"
requirement.

Michael Wojcik mi************@microfocus.com
The way things were, were the way things were, and they stayed that way
because they had always been that way.  Jon Osborne
jacob navia wrote: Michael Mair wrote:
jacob navia wrote:
You got me there  what do you need long doubles for when you want to print a signed long long int? Jeeeeez.... Sorry about that. It should have been "%Ld" of course!!! Excuse me.
You probably mean "%L[eEfFgG]". Apart from that: How bad can the rounding error be when only working with long doubles? As every binary fraction has a finite decimal fraction representation, it should be theoretically possible to print out with a certain rounding behaviour and no deviation (maybe I am too naive with respect to the cost).
The complications arise with subnormal numbers, i.e. numbers just below the normalization threshold, typically the results of underflow. Gcc (and lccwin32) can print those numbers with great precision because of the extended precision module, where the underflow is eliminated.
I see.
Other problems arise when trying to print the infamous *last* digit accurately, because it must be rounded, and not truncated as it would be staying with the given precision.
Okay, nobody wants to run through all the decimal digits to sum
it up finding out where you actually are...
Thank you for the explanations :)
Michael

EMail: Mine is an /at/ gmx /dot/ de address.
"Eric Sosman" <er*********@sun.com> wrote in message
news:co**********@news1brm.Central.Sun.COM... Daniel Fadlun wrote: "Gordon Burditt" <go***********@burditt.org> ha scritto nel messaggio news:co********@library1.airnews.net...
Is there a bigger, mathematical, data type in C than the double (64
bit) one
or the old long double (80 bit)?
C doubles are not guaranteed to be 64 bits. long double is not guaranteed to be 80 bits, and why is it the *OLD* long double?
Do you have floatingpoint hardware that uses more than 80 bits to represent a number?
I'd like to add precision to my mathematical application, but I can't
figure
out how.
An int could conceivably be 128 bits, although if your machine has 128bit operations, the 128bit integer type is more likely long long.
Gordon L. Burditt
My machine is a p4 pc using Windowsme; I would like to add decimals to my results example instead of 17 decimals 30 or 40.
That's 100133 significand bits. Hformat numbers on the VAX could approach the lower end (I don't recall just how many of its 128 bits were exponent), but I'm not aware of any C compiler that made use of Hformat.
The big question, though, is why do you want so many digits? What meaning could you assign to a plusorminus one fluctuation in the fortieth decimal place? If you're trying to calculate the radius of the Universe in Angstrom units, forty places are far more than you need.
Since the universe is a simple place, one might like to see the order of the
largest sporadic simple group, which is a good deal larger than 40 places.
I claim that it's the largest meaningful integer. MPJ
On Wed, 24 Nov 2004 22:21:08 +0100
jacob navia <ja***@jacob.remcomp.fr> wrote: sa*****@hetnet.nl wrote:
On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun" <mu**********@fastwebnet.it> wrote:
Is there a bigger, mathematical, data type in C than the double (64bit) one>or the old long double (80 bit)?I'd like to add precision to my mathematical application, but I can't figure>out how.
yes GMP.
Introduction to GNU MP
GNU MP is a portable library written in C for arbitrary precision arithmetic on integers, rational numbers, and floatingpoint numbers. It aims to provide the fastest possible arithmetic for all applications that need higher precision than is directly supported by the basic C types.
ftp.gnu.org/gnu/gmp Nice package. It is approx twice as fast as lccwin32. It doesn't really run under windows though, and even if I have heard of unsupported ports, nothing really official exist for windows, as far as I know.
Please correct me if I am wrong.
You are wrong. The standard documentation for GMP includes instructions
on building with either mingw (which is native Windows) and Microsoft C
(about which I will let you guess).
It is twice as fast because it uses a variable precision number system, reducing the number of calculations to be done for small numbers. Besides it has a lot of assembly in it, maybe one of the reasons there isn't a windows version (besides the cygwin emulator)
Well, the processor is the same whether you are using Linux on x86 or
Windows on x86, so what makes you think using assembler would be a
problem?
C library support is not provided with the package, i.e. all the functions of the C library aren't supported even if it has the most important ones (sqrt, etc).
All in all, the best thing around.
So stop recommending your completely nonstandard and nonportable
extensions around here.

Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Flash Gordon wrote: On Wed, 24 Nov 2004 22:21:08 +0100 jacob navia <ja***@jacob.remcomp.fr> wrote:
sa*****@hetnet.nl wrote:
On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun" <mu**********@fastwebnet.it> wrote:
Is there a bigger, mathematical, data type in C than the double (64
bit) one>or the old long double (80 bit)?
I'd like to add precision to my mathematical application, but I
can't figure>out how.
yes GMP.
Introduction to GNU MP
GNU MP is a portable library written in C for arbitrary precision arithmetic on integers, rational numbers, and floatingpoint numbers. It aims to provide the fastest possible arithmetic for all applications that need higher precision than is directly supported by the basic C types.
ftp.gnu.org/gnu/gmp
Nice package. It is approx twice as fast as lccwin32. It doesn't really run under windows though, and even if I have heard of unsupported ports, nothing really official exist for windows, as far as I know.
Please correct me if I am wrong.
You are wrong. The standard documentation for GMP includes instructions on building with either mingw (which is native Windows) and Microsoft C (about which I will let you guess).
I have downloaded the package from the official GNU site and there
is NO mention of windows in it, nor any Microsoft C workspace or
project. As such, the package will not even configure under
windows since it supposes the existence of /bin/sh.
Please, cygwin is not native windows, since needs a copyrighted
library callled cygwin.dll to run. This is quite expensive
if you do not want your code GPLed, license for it runs at
18.000 US$ last time I heard, to pay to RedHat Corp. It is twice as fast because it uses a variable precision number system, reducing the number of calculations to be done for small numbers. Besides it has a lot of assembly in it, maybe one of the reasons there isn't a windows version (besides the cygwin emulator)
Well, the processor is the same whether you are using Linux on x86 or Windows on x86, so what makes you think using assembler would be a problem?
The assembler syntax is not the same, even if the opcodes are the
same. C library support is not provided with the package, i.e. all the functions of the C library aren't supported even if it has the most important ones (sqrt, etc).
All in all, the best thing around.
So stop recommending your completely nonstandard and nonportable extensions around here.
Yes, I will. I know I am an (expletive deleted) as your friend Mr Pop
said, and you are the best GNU fan I have ever met. You should be
promoted to a higher position after your diatribes.
The problem with me is that I am NOT GPL, so I could be a competitor
for the GNU business plan. Therefore, insulting me, crying "GO AWAY"
and telling that my work is "NOT C" , "NON PORTABLE", etc is useful for
GNU.
This is how GNU sees "competition". Interesting, Microsoft people are
more restrained. They just tell that "free software is bad" or
"lccwin32 is a buggy package" but I have never been insulted from
them, nor do they rise Hell when I post in their discussions groups.
Another monopoly, different habits.
jacob mw*****@newsguy.com (Michael Wojcik) wrote: In article <co**********@rumours.uwaterloo.ca>, dj******@csclub.uwaterloo.ca (Dave Vandervies) writes: In article <41***********************@dreader16.news.xs4all.n l>, dandelion <da*******@meadow.net> wrote: Which by the way poses the queston wether or not 2's complement is mandated/required by the standard or merely by many CPU's (i assume it's the latter, but the question is a real one *and* topical)
Not required by the standard.
I believe C99 requires one of binary 2scomplement, binary 1scomplement, or binary signmagnitude for signed integer types. I'm not sure what C90 has to say on the subject.
I asked about that a few years back, and the consensus was that the requirements in C90  a "pure binary" number system and so forth  in effect eliminated any other possibilities than the three you mention above.
Not entirely. There is at least one other possibility, which could
provisionally be called signmagnitudeminusone, and which is to sm as
2's complement is to 1's c. 1 would be 10..00, 2 10..01, 3 10...10,
etc. I've never seen anything which actually uses this, and of course
it's highly unlikely that such a system even exists or ever will, but
AFAICT the wording in C89 doesn't forbid it.
Richard
In article <41**********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes: Flash Gordon wrote: On Wed, 24 Nov 2004 22:21:08 +0100 jacob navia <ja***@jacob.remcomp.fr> wrote:
....Nice package. It is approx twice as fast as lccwin32. It doesn't really run under windows though, and even if I have heard of unsupported ports, nothing really official exist for windows, as far as I know.
Please correct me if I am wrong.
You are wrong. The standard documentation for GMP includes instructions on building with either mingw (which is native Windows) and Microsoft C (about which I will let you guess).
I have downloaded the package from the official GNU site and there is NO mention of windows in it, nor any Microsoft C workspace or project. As such, the package will not even configure under windows since it supposes the existence of /bin/sh.
Look in the file gmp.info1. But maybe
<http://www.cs.nyu.edu/exact/core/gmp/> helps?

dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
In <41***********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes: Most quality implementation of printf include a higher precision module, see for instance the implementation of gcc.
gcc, being a mere compiler, doesn't come with a printf implementation.
If you're unable to understand something as simple as that, how can you
expect anyone to take your opinions seriously? You just can't miss *any*
opportunity to make a fool of yourself.
Dan

Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
In article <41**********************@news.wanadoo.fr>,
jacob navia <ja***@jacob.remcomp.fr> wrote: Flash Gordon wrote:
So stop recommending your completely nonstandard and nonportable extensions around here.
The problem with me is that I am NOT GPL, so I could be a competitor for the GNU business plan. Therefore, insulting me, crying "GO AWAY" and telling that my work is "NOT C" , "NON PORTABLE", etc is useful for GNU.
Yep, we just love GNUC and the GCC extensions around here. They're the
best thing since Bill Gates first invented the language.
Microsoft's extensions aren't actually all that bad either. It's just
you, with your particular notquiteC compiler, that we have an irrational
desire to persecute.
dave

Dave Vandervies dj******@csclub.uwaterloo.ca
If the user can hack the kernel, they can change the file permissions for the
executable. Of course they my *prefer* to hack the kernel, because that has
more Macho Kernel Hacker Points. Chris Dollin in comp.lang.c
In <41**********************@news.wanadoo.fr> jacob navia <ja***@jacob.remcomp.fr> writes: Flash Gordon wrote: On Wed, 24 Nov 2004 22:21:08 +0100 jacob navia <ja***@jacob.remcomp.fr> wrote:
sa*****@hetnet.nl wrote:
On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun" <mu**********@fastwebnet.it> wrote:
>Is there a bigger, mathematical, data type in C than the double (64
bit) one>or the old long double (80 bit)?
>I'd like to add precision to my mathematical application, but I
can't figure>out how.
yes GMP.
Introduction to GNU MP
GNU MP is a portable library written in C for arbitrary precision arithmetic on integers, rational numbers, and floatingpoint numbers. It aims to provide the fastest possible arithmetic for all applications that need higher precision than is directly supported by the basic C types.
ftp.gnu.org/gnu/gmp
Nice package. It is approx twice as fast as lccwin32. It doesn't really run under windows though, and even if I have heard of unsupported ports, nothing really official exist for windows, as far as I know.
Please correct me if I am wrong.
You are wrong. The standard documentation for GMP includes instructions on building with either mingw (which is native Windows) and Microsoft C
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (about which I will let you guess).
I have downloaded the package from the official GNU site and there is NO mention of windows in it, nor any Microsoft C workspace or project. As such, the package will not even configure under windows since it supposes the existence of /bin/sh.
One doesn't have to be a genius in order to type "gnu mp windows" into
the Google search engine. The third hit is "GMP Install Instruction
for Windows Platform".
Please, cygwin is not native windows, since needs a copyrighted
^^^^^^library callled cygwin.dll to run. This is quite expensive if you do not want your code GPLed, license for it runs at 18.000 US$ last time I heard, to pay to RedHat Corp.
Please, learn to read! He was talking about mingw, not about cygwin.
Are you so stupid that you cannot tell the difference?
Anyway, here is the first part of the Google hit mentioned above (URL: http://www.cs.nyu.edu/exact/core/gmp/)
Currently Core Library (from v1.4) uses GNU Multiple Precision
Arithmetic Library (GMP) as its low level big number package. GMP
is a free library for arbitrary precision arithmetic, operating on
signed integers, rational numbers, and floating point numbers. As
GMP was originally designed to work under Unix platform, there is few
information about how to compile and install under Windows platform. I
wrote this page to help you simplify installation.
While there are many C/C++ compilers available under Windows Platform,
I will only focus on the following 4 compilers/environments: Cygwin
GCC, MinGW GCC, Visual C++ 6.0 and .Net which are freely available
or widely used. If you have experiences on other compilers, please
let me know.
Is Visual C++ 6.0 native Windows enough for you, or only lccwin32 (which
is blissfully ignored by the author of that port) qualifies as such?
Dan

Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
"dandelion" <da*******@meadow.net> wrote: Which by the way poses the queston wether or not 2's complement is mandated/required by the standard or merely by many CPU's (i assume it's the latter, but the question is a real one *and* topical)
Unfortunately not, otherwise the volume of this newsgroup
would be half what it is.
"Dan Pop" <Da*****@cern.ch> wrote in message
news:co**********@sunnews.cern.ch... In <41**********************@news.wanadoo.fr> jacob navia
<ja***@jacob.remcomp.fr> writes:Flash Gordon wrote: On Wed, 24 Nov 2004 22:21:08 +0100 jacob navia <ja***@jacob.remcomp.fr> wrote:
sa*****@hetnet.nl wrote:
>On Tue, 23 Nov 2004 22:51:17 +0100, "Daniel Fadlun" ><mu**********@fastwebnet.it> wrote: > > >>Is there a bigger, mathematical, data type in C than the double (64 > >bit) one>or the old long double (80 bit)? > >>I'd like to add precision to my mathematical application, but I > >can't figure>out how. > > >yes GMP. > >Introduction to GNU MP > >GNU MP is a portable library written in C for arbitrary precision >arithmetic on integers, rational numbers, and floatingpoint >numbers. It aims to provide the fastest possible arithmetic for all >applications that need higher precision than is directly supported >by the basic C types. > >ftp.gnu.org/gnu/gmp >
Nice package. It is approx twice as fast as lccwin32. It doesn't really run under windows though, and even if I have heard of unsupported ports, nothing really official exist for windows, as far as I know.
Please correct me if I am wrong.
You are wrong. The standard documentation for GMP includes instructions on building with either mingw (which is native Windows) and Microsoft C ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (about which I will let you guess).
I have downloaded the package from the official GNU site and there is NO mention of windows in it, nor any Microsoft C workspace or project. As such, the package will not even configure under windows since it supposes the existence of /bin/sh.
One doesn't have to be a genius in order to type "gnu mp windows" into the Google search engine. The third hit is "GMP Install Instruction for Windows Platform".
Please, cygwin is not native windows, since needs a copyrighted ^^^^^^library callled cygwin.dll to run. This is quite expensive if you do not want your code GPLed, license for it runs at 18.000 US$ last time I heard, to pay to RedHat Corp.
Please, learn to read! He was talking about mingw, not about cygwin. Are you so stupid that you cannot tell the difference?
Anyway, here is the first part of the Google hit mentioned above (URL: http://www.cs.nyu.edu/exact/core/gmp/)
Currently Core Library (from v1.4) uses GNU Multiple Precision Arithmetic Library (GMP) as its low level big number package. GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers. As GMP was originally designed to work under Unix platform, there is few information about how to compile and install under Windows platform. I wrote this page to help you simplify installation.
While there are many C/C++ compilers available under Windows Platform, I will only focus on the following 4 compilers/environments: Cygwin GCC, MinGW GCC, Visual C++ 6.0 and .Net which are freely available or widely used. If you have experiences on other compilers, please let me know.
Is Visual C++ 6.0 native Windows enough for you, or only lccwin32 (which is blissfully ignored by the author of that port) qualifies as such?
In my usual state of semiunderstanding (Cygwin C++6 sounds like a Harry
Potter spell to me), I'd like to ask the following:
Is GMP ANSI/ISO conforming?
The literature is really thin on arbitrary precision stuff. Borwein and
Borwein is the best reference I've read. MPJ This discussion thread is closed Replies have been disabled for this discussion. Similar topics
11 posts
views
Thread by Lorenzo Villari 
last post: by

4 posts
views
Thread by Dan 
last post: by

6 posts
views
Thread by LordHog 
last post: by

2 posts
views
Thread by James Radke 
last post: by

4 posts
views
Thread by Peter 
last post: by

31 posts
views
Thread by aarklon 
last post: by
 
11 posts
views
Thread by sofeng 
last post: by

6 posts
views
Thread by Protoman 
last post: by
          