-----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 <aaron.lewis1...@gmail.com> > 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 , then we >> consider the `0' is not accurate , while `.34' is accurate. > > What?!
See: http://en.wikipedia.org/wiki/Arithmetic_precision > >> >> So for a number stored in a double type , how accurate can it be ? (or >> maybe how many bits in the fixed-point part is accurate) > > http://en.wikipedia.org/wiki/Double_precision_floating-point_format > >> >> Doesn't matter if it's unsigned or signed , some ideas are cool enough. > > I'd like to see your unsigned double! Sorry , they're all signed. > >> >> Still , use a small part of code , c or c++ , i'm just curious how to >> make it happen. > > What problem (i.e. homework assignment) are you trying to solve? > > Come on , just for fun , someone asks me if i could print out the maximum number that can be stored in a double type , and the *precision* of a double type. For the first , maybe with some bit operations , no good idea from me. And the second , well i tried to divide 2 by 3 , see when i reaches 7 ( should be 0.66....7 ) , may not a clever way. - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxC9EsACgkQvf41sEptMqD8CACfVFw2rSxQHBs1u8hLgltLIEr3 heUAniQgV+JEyy/WLr+IsV3mtIGUznM+ =xwd7 -----END PGP SIGNATURE-----