|  | large integers? |  | |
| | | jackie |  |
| Posted: Wed Aug 20, 2008 10:02 am Post subject: large integers? |  |
hi,all: one of my pals want to use integers of about 15 digits to do some calculation,as far as i know,c99 supports long long and that type would be enough,but,many compiler don't support long long,so is there any other way to tackle this problem,thx.. |
| |
| | | Richard Heathfield |  |
| Posted: Wed Aug 20, 2008 10:02 am Post subject: Re: large integers? |  |
jackie said:
| Quote: | hi,all: one of my pals want to use integers of about 15 digits to do some calculation,as far as i know,c99 supports long long and that type would be enough,but,many compiler don't support long long,so is there any other way to tackle this problem,thx..
|
Obtain, or write, a "bignum" library.
The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
Writing your own is, however, a lot of fun and rather instructive.
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| | | Richard Heathfield |  |
| Posted: Wed Aug 20, 2008 10:02 am Post subject: Re: large integers? |  |
Tristan Miller said:
| Quote: | Greetings.
In article 24a26455-580e-4956-a3c5-dffc567e4073@j33g2000pri.googlegroups.com>, jackie wrote:
hi,all: one of my pals want to use integers of about 15 digits to do some calculation,as far as i know,c99 supports long long and that type would be enough,but,many compiler don't support long long,so is there any other way to tackle this problem,thx..
Why not simply find a compiler which *does* support long long integers?
|
Well, fair point - but the next question will then be "oh, it turns out we need 40-digit integers after all", and then we're reduced to recommending that he tries to find a compiler that has long longs that are at least 132 bits wide...
Easier to point him at bignums right off the bat. :-)
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| | | Tristan Miller |  |
| Posted: Wed Aug 20, 2008 10:34 am Post subject: Re: large integers? |  |
Greetings.
In article <24a26455-580e-4956-a3c5-dffc567e4073@j33g2000pri.googlegroups.com>, jackie wrote:
| Quote: | hi,all: one of my pals want to use integers of about 15 digits to do some calculation,as far as i know,c99 supports long long and that type would be enough,but,many compiler don't support long long,so is there any other way to tackle this problem,thx..
|
Why not simply find a compiler which *does* support long long integers? Is your friend using an operating system so obscure that, say, GCC is not available for it?
Regards, Tristan
-- _ _V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited / |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard (7_\\ LINK >< To finish what you |
| |
| | | Richard Heathfield |  |
| Posted: Wed Aug 20, 2008 12:05 pm Post subject: Re: large integers? |  |
Nick Keighley said:
| Quote: | On 20 Aug, 11:09, Richard Heathfield <r...@see.sig.invalid> wrote:
snip
The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
it's full GPL I believe,
|
Ta.
| Quote: | which may limit its use in commercial products.
|
ICBW about this, but I *guess* the OP isn't too worried about that.
| Quote: | No I don't want an argument about this...
|
Pfui. Life's too short. :-)
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| | | Ben Bacarisse |  |
| Posted: Wed Aug 20, 2008 12:41 pm Post subject: Re: large integers? |  |
Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
| Quote: | On 20 Aug, 11:09, Richard Heathfield <r...@see.sig.invalid> wrote:
snip
The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
it's full GPL I believe, which may limit its use in commercial products.
|
It is LGPL, so that is unlikely.
| Quote: | No I don't want an argument about this...
|
I hope you exclude factual errors from that!
-- Ben. |
| |
| | | Nick Keighley |  |
| Posted: Wed Aug 20, 2008 1:28 pm Post subject: Re: large integers? |  |
On 20 Aug, 11:09, Richard Heathfield <r...@see.sig.invalid> wrote:
<snip>
| Quote: | The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
|
it's full GPL I believe, which may limit its use in commercial products.
No I don't want an argument about this...
-- Nick Keighley |
| |
| | | Richard Bos |  |
| Posted: Wed Aug 20, 2008 1:39 pm Post subject: Re: large integers? |  |
Tristan Miller <psychonaut@nothingisreal.com> wrote:
| Quote: | Keighley wrote:
On 20 Aug, 11:09, Richard Heathfield <r...@see.sig.invalid> wrote:
The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
it's full GPL I believe, which may limit its use in commercial products.
There's no limit on the use of GPL code in commercial products.
|
In theory. In practice, the use of GPL code for commercial products is severely limited by the amount of money lawyers can wring out of the edge cases.
Richard |
| |
| | | Richard Harter |  |
| Posted: Wed Aug 20, 2008 2:41 pm Post subject: Re: large integers? |  |
On Wed, 20 Aug 2008 10:09:01 +0000, Richard Heathfield <rjh@see.sig.invalid> wrote:
| Quote: | jackie said:
hi,all: one of my pals want to use integers of about 15 digits to do some calculation,as far as i know,c99 supports long long and that type would be enough,but,many compiler don't support long long,so is there any other way to tackle this problem,thx..
Obtain, or write, a "bignum" library.
The two bignum libraries most commonly recommended are Miracl (by Shamus Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial use last time I looked, and GMP is covered by either GPL or LGPL, I forget which.
Writing your own is, however, a lot of fun and rather instructive.
|
Any info on packages that are covered by a BSD style license?
Richard Harter, cri@tiac.net LINK LINK Save the Earth now!! It's the only planet with chocolate. |
| |
| | | Richard Heathfield |  |
| Posted: Wed Aug 20, 2008 2:47 pm Post subject: Re: large integers? |  |
Richard Harter said:
| Quote: | On Wed, 20 Aug 2008 10:09:01 +0000, Richard Heathfield rjh@see.sig.invalid> wrote:
snip
Writing your own is, however, a lot of fun and rather instructive.
Any info on packages that are covered by a BSD style license?
|
Not that I know of. Writing your own is, however, a lot of fun and rather instructive. :-)
-- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
| |
| Page 1 of 3 .:. Goto page 1, 2, 3 Next | |
|
|