Java Find the length of BigInteger?
By:Roy.LiuLast updated:2019-08-11
In Java, we can convert the BigInteger to a String object and get the length of the String.
JavaExample.java
package com.mkyong; import java.math.BigInteger; public class JavaExample { public static void main(String[] args) { BigInteger bigInteger = BigInteger.valueOf(100000000000000000L); //18 System.out.println(bigInteger.toString().length());
Output
18
References
From:一号门
Previous:mvn site : java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
COMMENTS