Re: calculate value of 73!
From: Richard Heathfield (dontmail_at_address.co.uk.invalid)
Date: 02/08/04
- Next message: Mark Shelor: "Re: calculate value of 73!"
- Previous message: Arthur J. O'Dwyer: "Re: undefined behavior or not undefined behavior? That is the question"
- In reply to: Mark Shelor: "Re: calculate value of 73!"
- Next in thread: Mark Shelor: "Re: calculate value of 73!"
- Reply: Mark Shelor: "Re: calculate value of 73!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 8 Feb 2004 09:07:09 +0000 (UTC)
Mark Shelor wrote:
> Saurabh Saxena wrote:
>
>> can we calculate the 73! value in c or c++ without loss of significant
>> digits.
>
>
> Saurabh,
>
> As you perhaps already know, the value of 73! is
>
> 44701154615126843408912571381250511100768007002829050158190800923704\
> 22104067183317016903680000000000000000
Right. (Well, it looks right at first glance; I haven't checked every
digit.)
> This is a value whose precision (number of digits in its representation)
> exceeds that of all integral and floating types defined by (drum roll
> please) ... THE STANDARD.
Not so. The Standard imposes no maxima on precision levels - only minima.
> In other words, to compute 73! using Standard
> C, you'll need to develop a multiple-precision data structure and
> associated computation procedure. There are myriad ways to do this;
> Knuth Vol. 2 is a useful reference.
Excellent advice.
>
> However, since the term "multiple-precision" is probably nowhere
> mentioned in (drum roll please) THE STANDARD, you may want to be careful
> about mentioning it any further, lest one of the newsgroup nannies, in
> their never-ending quest for absolute purity, raps you on the knuckles
> with a hard ruler.
This is unlikely. It is, however, true that the writing of "multiple
precision" libraries is less to do with C and more to do with programming.
Having said that, if someone were to run into a C problem whilst
programming a multiple precision library, I see no reason why they
shouldn't seek help for their C question here.
-- Richard Heathfield : binary@eton.powernet.co.uk "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999. C FAQ: http://www.eskimo.com/~scs/C-faq/top.html K&R answers, C books, etc: http://users.powernet.co.uk/eton
- Next message: Mark Shelor: "Re: calculate value of 73!"
- Previous message: Arthur J. O'Dwyer: "Re: undefined behavior or not undefined behavior? That is the question"
- In reply to: Mark Shelor: "Re: calculate value of 73!"
- Next in thread: Mark Shelor: "Re: calculate value of 73!"
- Reply: Mark Shelor: "Re: calculate value of 73!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|