久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 Java 中將二進(jìn)制數(shù)轉(zhuǎn)換為 BigInteger?

How do you convert A binary number to a BigInteger in Java?(如何在 Java 中將二進(jìn)制數(shù)轉(zhuǎn)換為 BigInteger?)
本文介紹了如何在 Java 中將二進(jìn)制數(shù)轉(zhuǎn)換為 BigInteger?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我需要將一個非常大的二進(jìn)制值轉(zhuǎn)換為其十進(jìn)制等效值.因?yàn)樗且粋€大整數(shù),所以我使用的是 BigInteger.那么如何將此二進(jìn)制數(shù)轉(zhuǎn)換為 BigInteger?

I needed to convert a very big binary value into its decimal equivalent. As it is a big integer I was using BigInteger. So how do I convert this binary number to a BigInteger?

推薦答案

如果你有二進(jìn)制數(shù)的 String 表示,將它提供給這個重載的 BigInteger 構(gòu)造函數(shù)以創(chuàng)建一個實(shí)例:

If you have the String representation of your binary number, provide it to this overloaded BigInteger constructor to create an instance:

BigInteger(String val, int radix);

在你的情況下,基數(shù)顯然是 2,即你可以使用這樣的東西:

In your case, radix is clearly 2, i.e. you can use something like this:

BigInteger yourNumber = new BigInteger("101000101110...1010", 2);

這篇關(guān)于如何在 Java 中將二進(jìn)制數(shù)轉(zhuǎn)換為 BigInteger?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 中文字幕一区二区三区四区 | 久久久久久国产一区二区三区 | 国产乱码一二三区精品 | 欧美日韩福利视频 | 久久噜噜噜精品国产亚洲综合 | 亚洲天堂一区 | 亚洲成人一区二区 | 精品一区二区三区在线观看 | 欧美在线观看免费观看视频 | 中文字字幕一区二区三区四区五区 | 黄色视频a级毛片 | 国产成人精品一区二区三区四区 | av国产在线观看 | 夜夜骑综合 | 日日摸夜夜添夜夜添精品视频 | 欧美13videosex性极品 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | www.97国产 | 欧美激情在线观看一区二区三区 | 国产精品亚洲成在人线 | 精品视频一区二区三区在线观看 | 久久久91精品国产一区二区精品 | 天堂网色| 成人欧美一区二区 | 91免费看片神器 | 精品成人av| www.日本三级 | 久久日韩粉嫩一区二区三区 | 男女av| 免费观看一级毛片 | 久久久久久久久久久一区二区 | 久久久av一区 | 皇色视频在线 | 91视频久久 | 国内精品久久久久久 | 日韩精品一区在线 | 免费观看一级特黄欧美大片 | 久久国产精品色av免费观看 | 日韩免费| 日韩精品一区二区三区四区 | 亚洲免费视频一区 |