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
3 answers

Java use GPU for calculating with BigInteger

I'm currently working on a project which involves allot of calculating with quiet large numbers which is why I use BigInteger. But obviously my application is really slow. I don't know allot about GPUs, but I heard that they can be used to calculate…
TheEquah
  • 121
  • 8
0
votes
4 answers

My simple calculation with Bigintegers are not working

I need to calculate this: 2894135^3787313 mod 4028033 As you can see below i tried to use the BigInteger because i have really huge numbers. import java.lang.Math; import java.util.Scanner; public class BigInteger extends Number implements…
Thomas
  • 45
  • 7
0
votes
4 answers

Working with BigIntegers in C#

I am testing out BigIntegers. When I take a large odd number and divide it by 2, I get an integer as an anwser, without any indication that it could not divide the number exactly. So first question is how do I know that two numbers divide exactly. I…
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
0
votes
1 answer

Bigint Division always returning zero

I am currently using a bigint class that was given to me. I have managed to create the adding subtracting and multiplication operations successfully, however I cannot seem to crack the division operator. I am not fussed on getting the remainder of…
0
votes
1 answer

Java BigInteger mod gives unexpected result

I am trying to implement a Cyclic Redundancy Check with Java and I made a quick code to see if it works as intended. I have to take a large amount of data (128 bytes) and check it with CRC, so I figured I should store the binary value in a…
Ebad
  • 131
  • 11
0
votes
1 answer

Byte Array Subtraction

I'm trying to implement my own version of BigInteger exclusively using byte arrays (byte[]) to represent the integers. As of right now, I have my addition method working: public static byte[] add(byte[] data1, byte[] data2) { …
bkrause404
  • 19
  • 8
0
votes
1 answer

How to write code more elegantly? (Factorials, BigDecimals, division by BigIntegers)

I've managed to make my code working, but feel like there's a better approach to writing similar stuff, any tips or mistakes to point out? Here's my code: public static void main(String[] args) { DecimalFormat df = new…
0
votes
1 answer

Handling large numbers and precision of Ricean Fading PDF python

I'm trying to calculate Ricean Fading PDF using following equation. RIcean Fading PDF. where 'y' is normalized envelope and 'gamma' is SNR if the K value is large, then math.exp(-((1.+_gamma)*pow(_y,2.) + _gamma)) exp results in big floating point…
0
votes
1 answer

Trying to encode in base 64 a byte array from a BigInteger in javaScript

I am trying to implement the exact same java algorythm in javaScript : String s = "6332878812086272"; // For example long id = Long.valueOf(s); final byte[] idBytes = BigInteger.valueOf(id).toByteArray(); final String idBase64 =…
Gwendal Le Cren
  • 490
  • 3
  • 17
0
votes
1 answer

How to check precondition to Burnikel and Ziegler division?

Burnikel and Ziegler's "RecursiveDivision" algorithm for dividing big numbers has two preconditions, one of which is "the Quotient Q must fit into n digits." How do you know if the precondition holds without first doing the division?
jjj
  • 23
  • 8
0
votes
1 answer

JavaScript big integer from string to base 2

How to from a JavaScript String, assuming that it will be converted to base 2 number representation, get length of it? var a =…
Ultra
  • 57
  • 8
0
votes
3 answers

How do I get my program to store every possible combination of 55 bits of an 81 bit BigInteger?

I'm making a Sudoku program, and I wanted to store every combination of x bits in an 81-bit integer into a list. I want to be able to then shuffle this list, iterate through it, and each on-bit will represent a cell that is to be removed from an…
user3376587
  • 134
  • 2
  • 12
0
votes
0 answers

RSA using BigInteger class

I am doing an image Steganography project and I am implementing RSA cryptography to make the hidden message more secure. I am using the BigInteger class, and the RSA on its own is ok, but when used after the encrypted text has been extracted from…
Null
  • 9
  • 3
0
votes
0 answers

convert a string containig 28bits to a BigInteger array? java

I'm just trying to do the encrypt algorithm (DES) in java. So the algorithm is say that must divide the key that containing 56 bits into two parts of 28bits. I have just try this to store the first and second half: String firstPart="",…
Sivar
  • 15
  • 6
0
votes
1 answer

How to do mod (10^9+7) for large numbers in Java

Coding puzzles generally ask to give result mod (10^9+7). Refer the explanations here. Suppose I have a 2 very big number; say 2 large string of numeric characters. I need to add them and result processed as mod (10^9+7). How can i achieve that.…
Kaushik Lele
  • 6,439
  • 13
  • 50
  • 76
1 2 3
99
100