Java BigInteger longValue() methodThe longValue() method of Java BigInteger class is used to convert this BigInteger to a long.This conversion is similar to the narrowing primitive conversion from long to int. Narrowing Primitive Conversion:According to The Java Language Specification, it is defined as ifthisBigInteger has too great magnitude to represent as along, it will return only the lower order 64 bits. Syntax:Returns:This method returns this BigInteger converted to a long. Note:ExampleTest it NowOutput: Result of longValueoperation on 123 is 123 Result of longValueoperation on -123 is -123 Result of longValue operationon12345678901234567890 is-6101065172474983726 Result of longValueoperation on -12345678901234567890 is 6101065172474983726 Next TopicJava BigInteger |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India