Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: BitSet vs BigInteger (false Android doc) Date: Tue, 06 Sep 2011 08:58:13 +0200 Organization: albasani.net Lines: 26 Message-ID: References: <4e613b65$0$311$14726298@news.sunsite.dk> <_ZGdna1ucfWYH__TnZ2dnUVZ_oudnZ2d@earthlink.com> <4e655c24$0$308$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net +8gkllYb7zK7ndrg5LYut5+oyfH0AchWtVQoQPKq+Is3GG4N950/bqgKSu7GNCB+vZ/IeLD8+6mAHXlJ4EOMtA== NNTP-Posting-Date: Tue, 6 Sep 2011 06:58:13 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="G1Xsnqx/kZ0p8D0SD2DuEW+B2ULTVYi5EyC2aaRKUzdnEYsS7VZlxXHMFwyUSDRoin0vGd+D0JrBXhnVuMAS0xKJHrQEv5/pefxT1TITJusJjVIdVT4vm7VApKyEmAyU"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Firefox/6.0.1 SeaMonkey/2.3.1 In-Reply-To: <4e655c24$0$308$14726298@news.sunsite.dk> Cancel-Lock: sha1:xYfX5xZj8D0zjZ+L7McS5Sg0vCw= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7611 Arne Vajhøj schrieb: > The BigInteger API has methods for converting between internal > representation and bytes in two complements. It should be obvious > that at least code that uses that feature will carry overhead > for an implementation not using two;s complement. No, the point is that this light handed reasoning does not work. Namely because: - BitSet is not dependent on some two's complement, sign-plus- magnitude or one's complement etc.., since these representations were invented for negative values. And BitSet does not work with an infinitely extended sign bit, which corresponds to a negative value. It has no not() operation. - BigInteger is also not dependent for positive values on some two's complement, sign-plus-maginitude or one's complement etc.., since these presentation were invented for negative values. So the Android javadoc comment is false in that it mentions an irrelevant aspect of the matter. Bye