Here you can find the source of getBinaryNumberInString(BigInteger integerNumber)
Parameter | Description |
---|---|
integerNumber | A integer number |
public static String getBinaryNumberInString(BigInteger integerNumber)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { /**/*from w w w . j av a 2 s. com*/ * A constant to represent the base/radix 2 */ private final static int BINARY_RADIX = 2; /** * This method gets the binary representation of any integer number.<br/> * The binary representation is returned in String format * @param integerNumber A integer number between {@link Integer#MIN_VALUE} and {@link Integer#MAX_VALUE} * @return The binary number in string format */ public static String getBinaryNumberInString(Integer integerNumber) { return Integer.toBinaryString(integerNumber); } /** * This method gets the binary representation of any integer number.<br/> * The binary representation is returned in String format * @param integerNumber A integer number * @return The binary number in string format */ public static String getBinaryNumberInString(BigInteger integerNumber) { return integerNumber.toString(BINARY_RADIX); } }