OT: Re: code for fun

2010-07-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/18/2010 06:56 PM, Firas Kraiem wrote: > On 18/07/2010 12:27, Aaron Lewis wrote: >> Hi, >> how can i determine the maximum size of `double' without printing out >> DOUBLE_MAX ? >> >> And what about the precision of a `double' , anyone gi

Re: OT: Re: code for fun

2010-07-18 Thread Floor Terra
On Sun, Jul 18, 2010 at 1:07 PM, Aaron Lewis wrote: >> What do you mean by "precision"? > > Kinda of significance digit. For example: > B A number `12.340' , and if say it has 2 digits' precision , then we > consider the `0' is not accurate , while `.34' is accurate. What?! > > So for a number s

Re: OT: Re: code for fun

2010-07-18 Thread Firas Kraiem
> > Assuming 64-bit double, it has a mantissa of 52 bits and an exponent of > > 11 bits. If the mantissa is all-ones, that will give a significant of > > 2-2^(-52). The exponent cannot be all-ones (an all-ones exponent means > > infinity or NaN), so the largest exponent is 2^11-2 = 2046, minus bia

Re: OT: Re: code for fun

2010-07-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/18/2010 08:04 PM, Floor Terra wrote: > On Sun, Jul 18, 2010 at 1:07 PM, Aaron Lewis > wrote: >>> What do you mean by "precision"? >> >> Kinda of significance digit. For example: >> A number `12.340' , and if say it has 2 digits' precision , th

Re: OT: Re: code for fun

2010-07-18 Thread Floor Terra
On Sun, Jul 18, 2010 at 2:32 PM, Aaron Lewis wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/18/2010 08:04 PM, Floor Terra wrote: >> On Sun, Jul 18, 2010 at 1:07 PM, Aaron Lewis wrote: What do you mean by "precision"? >>> >>> Kinda of significance digit. For example: >>> B