Questions tagged [biginteger]

BigInteger is an arbitrary-precision arithmetic type in Java, C#, and other languages. It behaves like a signed integer whose size is limited only by available memory.

BigInteger is an arbitrary-precision arithmetic type in the .NET Framework, Java, and other languages. It behaves like a signed integer whose size is limited only by available memory.

1971 questions
0
votes
1 answer

How to create asymmetric keys in C# because of limited exponent size?

I am creating a little software to encrypt and decrypt data using asymmetric keys. The problem is, I am coding in C# and even if I use : BigInteger.Pow(BigIntenger myNumber, int myExponent); The exponent is an "int" and my value is to big for an…
Romain P
  • 5
  • 2
0
votes
0 answers

Openssl and pyopenssl return negative SN. Convert to positive?

I have problem when I get serial number from certificate over openssl and over pyopenssl. I get at some of certificates negative number but Windows gui or Unity GUI in ubuntu return positive serial number. How can I convert negative serial number to…
spirit123
  • 41
  • 1
  • 6
0
votes
2 answers

BigInt class. Adding, Substraction

I have to write own class for operation on very big numbers. Already have adding: char index1 = liczba1.length(); char index2 = liczba2.length(); stack wyniki; while (index1 > 0 || index2 > 0) { index1--; index2--; …
0
votes
0 answers

C help - Converting mpz to unsigned char array

I m learning C an I have ome issues. First, i m using library gmp and I need to convert a mpzt to an unsigned char array. I already lookup on documentation but I dont find anything. Maybe using mpz_get_str but I dont known how. More over I have to…
jhd
  • 1
0
votes
1 answer

ClassCastException when looping through the list populated using Hibernate query

I have a List ids populated by database query (Hibernate). The database is PSQL. The ids column is bigint type. Now the ids list is populated without any exception like this List ids = getIds();//getIds returns List but when I try to…
krltos
  • 313
  • 4
  • 20
0
votes
1 answer

Effective way to loop through BigInteger

I'm looping through BigInteger like this: BigInteger i = new BigInteger(Long.MAX_VALUE + ""); BigInteger end = i.add(new BigInteger("10")); // Display results for (i = new BigInteger(Long.MAX_VALUE + ""); i.compareTo(end) <=…
user7697994
0
votes
1 answer

How to raise double to bigInteger in java

I need to calculate the $a^b$ where a is BigInteger and b is double is it possible to do so in java?
Karen
  • 3
  • 2
0
votes
2 answers

OpenSSL BN_exp() Usage

I have a small program that uses BIGNUM functions BN_exp() and BN_mod_exp() on 64-byte big integers (that are generated via BN_generate_prime_ex()). Every time I compile and run, the program pauses forever while computing the first call to BN_exp().…
jmu_nova
  • 51
  • 2
  • 10
0
votes
0 answers

What are pros and cons of using BigDecimal compared to BigInt for rational numbers?

If I have to design, say, a financial application that uses rational numbers (i.e., numbers with a fractional component), what datatype should I use for internally doing calculations? I have two options: Use BigInt (BigInteger in Java) and emulate…
Jus12
  • 17,824
  • 28
  • 99
  • 157
0
votes
3 answers

Java unsigned bitshift on BigInteger

I'm trying to apply an unsigned shift on the right but I cannot find the way to do it. Is there anyone who knows? Sample code: BigInteger bi; bi.shiftRight(7) // equals >> 7 How to apply >>> 7 ? Duplicate? Please stahp, I don't have my answer.
Romeortec
  • 211
  • 1
  • 2
  • 11
0
votes
3 answers

The method add(long) from the type BigInteger is not visible

How can I add any numbers to a BigInteger? I am getting this error in eclipse:- The method add(long) from the type BigInteger is not visible import java.math.BigInteger; public class M { public static void main(String[] args) { …
user8110081
0
votes
0 answers

Karatsuba multiplication not working recursively with BigInteger

I am trying to multiply n digit number using karatsuba multiplication. I am getting output for single digit number (Example 4 and 5 = 20). But, when I multiply 1234 and 5678 I am getting error and no output result. I have updated the code and…
Sid
  • 29
  • 7
0
votes
0 answers

SQL Server: how to change INT column to BIGINT?

I have a big table (500 000 000 rows) like create table x ( id int not null identity(1,1) primary key, name nvarchar(MAX), type int ) The value id is already near MAXINT, that is why I need to change the type from INT to BIGINT. This…
ZedZip
  • 5,794
  • 15
  • 66
  • 119
0
votes
1 answer

Convert String to BigInteger in C++

I'm using the BigInteger library. However when converting from string to BigInteger I summon the error "no matching function for call BigInteger(string&)". How should one convert from between the two without invoking an error? Here is a snippit of…
Dave
  • 454
  • 1
  • 7
  • 17
0
votes
1 answer

How to devide a BigInteger by a double in Java?

The title says it all: How do I divide a BigInteger by a floating point number in Java? I don’t need the fraction part of the division, it is okay to have it either rounded or truncated (however I would be interested which one applies). The…
Matthias Ronge
  • 9,403
  • 7
  • 47
  • 63