JDK 8 BigInteger Exact Narrowing Conversion Methods

In the blog post, "Exact Conversion of Long to Int in Java," I discussed using Math.toIntExact(Long) to convert a Long to an int , using an ArithmeticException if this narrowing conversion is not possible. That method was introduced with JDK 8, which also introduced similar narrowing conversion methods to the BigInteger class. Those BigInteger methods are the topics of this post.

BigInteger had four new "exact" methods added to it in JDK 8:

What feeling does this article give you?

#hashtags to follow:

Exact Conversion [+]    Int [+]    Java [+]    ArithmeticException [+]    JDK 8 [+]    BigInteger [+]   

More #news: