Questions tagged as 'biginteger'

2
answers

Method equivalent to BigInteger.and () in C #

I need to convert the java code below to C #: public static boolean verificaPermissao(BigInteger perm1, BigInteger perm) { if (perm1 == null || perm == null || (perm1.equals(BigInteger.ZERO) || (perm.equals(BigInteger.ZERO)))) ret...
asked by 04.05.2017 / 19:15
1
answer

Overflow by multiplying two integers in BigInteger

I'm starting Java studies and I have one task: to generate two random integers and store their multiplication. For this, I tried to use long and BigInteger . But the result of this multiplication is almost always negative. Why? in...
asked by 29.04.2016 / 18:37
2
answers

Long Swap for BigInteger or BigDecimal?

I'm trying to read from the keyboard a very large integer, I saw that there are BigInteger or Bigdecimal types, I do not know if they are larger than Long. I wanted to read from the keyboard numbers with 10 or 14 digits but Long is not suppor...
asked by 12.06.2016 / 00:54
1
answer

Use of the Big Integer class in the construction of an MD5 hash

I found in another post right here from the OS the following code example for generating a hash through MD5: String message = "teste1234"; byte[] hash = MessageDigest.getInstance("MD5").digest(message.getBytes("UTF-8")); System.out.println("MD...
asked by 27.03.2016 / 20:03
1
answer

How to convert decimal to binary with large numbers?

I'm creating a C # language program to perform conversions right now I'm implementing the binary - > decimal and decimal - > binary. How can I do the conversion if the user types large numbers how should I handle this? Buttons priv...
asked by 02.12.2015 / 12:07