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

SQL Azure Sharding and Social Networking Apps

The concept of sharding on SQL azure is one of the top recommended options to get over the 50Gb DB size limit, it has at the moment. A key strategy in sharding is to group related records called atomic units together in a single shard , so that the…
0
votes
0 answers

What is the most optimal method for calculating very, very large numbers? Namely, in context of an exponential game?

Right now, my current method for updating very large numbers is the follows: Keep track of the health of a given monster, to be attacked, with both a double to keep track of significant digits, and an int to keep track of the power If the…
G0mega
  • 1
0
votes
3 answers

handle snippet code wrtten in C for large numbers

I wrote this snippet code as a solution for a problem but in a test case that tries big numbers as input(for example 10000000000 10000000000 1), a weird output comes out.it's work for integer range number but how can I handle code for big numbers?…
0
votes
1 answer

How would I overload the + operator for this bigint class which uses arrays? C++

I am currently taking an online data structures course using C++ and I'm working on a personal project to help me better understand the basics. The project I'm working on is an implementation of a bigint class, a class that supports storing and…
babakahn
  • 25
  • 1
  • 5
0
votes
2 answers

Calculate very big unsigned int in C

I have 32 bytes numbers and i store them in a uint8_t* buffer. How to calculate a 32 bytes number in C? Example: add, mod, multiplication Thanks!
H.Hoang
  • 11
  • 4
0
votes
1 answer

Java using ValueAnimator with BigInteger?

I'm trying to animate between two values using BigInteger instead of int like I was using before. So far I have not found a way to do this, is it possible? final ValueAnimator amountAnimation = ValueAnimator.ofInt(initialValue, finalValue); Of…
zngb
  • 601
  • 1
  • 7
  • 24
0
votes
1 answer

do these two methods (one with integer and one with BigInteger types) match?

I would need to know if and how these two for loop methods are matching, that according to their own syntax (the two methods with 'integer' type are correct and tested, but the two analogues with 'BigInteger' type are not). Are the two methods (of…
Toxiro
  • 25
  • 4
0
votes
2 answers

Why does big-integer give me `0` when calculating the following expression?

I'm using big-integer module to deal with big numbers. When I'm trying to calculate the following expression I get 0: console.log(bigInt('13775000000000000000').divide('2500000000000000000000')); // 0 But when trying to calculate in pure JS…
Erik
  • 14,060
  • 49
  • 132
  • 218
0
votes
1 answer

Concatenation of several Strings to use for encryption

I have an encryption method which converts several Strings each to byte[] and appends them to an array to perform later an encryption. Now I have to use an other method which receives only one String to perform the same encryption. I get the same…
Ana
  • 1
  • 1
0
votes
0 answers

ZendDB Adapter - BIGINT returned as wrong int in php

I'm using ZF1 latest version. My table looks like this: CREATE TABLE `mytable` ( `id` INT(11) NOT NULL DEFAULT '0', `right_value` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY…
Ron
  • 22,128
  • 31
  • 108
  • 206
0
votes
3 answers

How to list the ones of a counting number?

What are the options to quickly list the 1's of a Java BigInteger? We can assume the BigInteger is positive, but it might be a rather large Java BigInteger with sparely distributed 1's. Nevertheless we would like to find them quickly. I would like…
user9307810
0
votes
2 answers

What algorithm BigInteger use to convert integer to byte array

It seems that Java has a very efficient way of converting Integer to byteArray using BigInteger.toByteArray() method, it is optimal in terms of space. So for integers in the range of 0-128, it will only use 1 byte, and for integers in the range of…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
0
votes
0 answers

BigInteger pow function not being calculated in Paillier Encryption

Here is my Paillier class: public class Paillier { private static BigInteger Nv; private static BigInteger Nc; private static BigInteger b; private static BigInteger p; private static BigInteger q; private static BigInteger…
0
votes
3 answers

How to use the equivalent of indexof() with biginteger in VB.Net?

I am trying to sum up the digits in a very large number. I have gotten the length of the number with l = answer.bitLength() but I can't figure out how to increament through each digit using a For loop. Any ideas? I'm using the…
Bryan
  • 1,851
  • 11
  • 33
  • 56
0
votes
1 answer

Pretending that a 64-bit integer has unlimited range

I am implementing a compiler for a proprietary language. The language has one built-in integer type, with unlimited range. Sometimes variables are represented using smaller types, for example if a and b are integer variables but b is only ever…