bignum Questions

3

Is there any compile-time library (template metaprogramming) for arbitrary-precision arithmetic in C++? I need this to help with fixed-point arithmetic and binary scaling in my program for A...

0

I'm still learning typescript/javascript and now I'm trying to replace existing code where BigNumber is used with bigint/BigInt. Originally I thought these types are the same (because typeof(...
Xena asked 22/1, 2023 at 17:36

1

I'm aware of https://floating-point-gui.de/ and the fact that there are many libraries available to help with big numbers, but I've surprisingly been unable to find anything that handles more than ...
Coenzyme asked 23/9, 2022 at 20:0

4

I am trying to call a custom function of a contract that expects a parameter of unit256. I'm calling this function from web3 with this value as parameter: 10000000000000000000 (10 with 18 zeros) As...
Scarlatti asked 10/6, 2020 at 11:1

1

I need to deal with bignum calculation (addition and subtraction, but I treat subtraction as equivalent to signed addition) on RISC-V and the situation is a bit complicated. What I gather from half...
Impiety asked 5/2, 2022 at 15:48

2

While I was working on smart contract using truffle, whenever request some number like account balance or address from the truffle console; I receive a BN object which looks like this: BN { negati...
Unhorse asked 12/6, 2021 at 6:16

14

Solved

I'd like to implement a big int class in C++ as a programming exercise—a class that can handle numbers bigger than a long int. I know that there are several open source implementations out th...
Wirework asked 6/11, 2008 at 16:11

2

Solved

Does emacs have support for big numbers that don't fit in integers? If it does, how do I use them?
Takahashi asked 3/9, 2009 at 6:1

6

Solved

I'm working with large numbers that I can't have rounded off. Using Lua's standard math library, there seem to be no convenient way to preserve precision past some internal limit. I also see there ...
Eleaseeleatic asked 13/11, 2008 at 23:10

5

Solved

On a Windows 32-bit platform I have to read some numbers that, this was unexpected, can have values as big as 99,999,999,999, but no more. Trying to sprintf("%011d", $myNum) them outputs an overflo...
Gur asked 6/5, 2009 at 7:43

8

Solved

To use modular exponentiation as you would require when using the Fermat Primality Test with large numbers (100,000+), it calls for some very large calculations. When I multiply two large numbers ...
Ecumenicity asked 17/10, 2008 at 7:49

2

perl -Mbigrat -E'for (1..100) { $i += 1/3; say int($i), "\t", sprintf "%.55f", $i }' spams a lot of warnings: Argument "100/3" isn't numeric in addition (+) at …/site_perl/5.24.1/Math/BigRat.pm ...
Dripps asked 26/5, 2017 at 23:31

1

Solved

I would like to loop through a range of values that have a BigUint type (from the num crate). How can I do this? I tried for i in 0..a {...} where a is a (borrowed) BigUint type. I got a error...
Vitrine asked 23/6, 2019 at 8:57

1

Solved

What are the meanings of the c, e, and s fields in the object produced by bignumber.js? For example: > new BigNumber('1234') { c: [1234], e: 3, s: 1 } > new BigNumber('12345678901234567890'...
Walkup asked 3/5, 2018 at 21:7

4

Solved

I have a large and "unique" integer (actually a SHA1 hash). Note: While I'm talking here about SHA1 hashes, this is not a cryptography / security question! I'm not trying to break SHA1. Imagine a ...
Enrage asked 13/1, 2011 at 18:10

3

I would like to add 2 arbitrarily sized integers in C++. How can I go about doing this?
Empyrean asked 28/5, 2010 at 1:56

1

I have a big integer below, as 'max'. How come the value dividing max by '27' is not equivalent to just completely omiting the first number '27'. Technically they should be equal, but in python the...
Logistician asked 10/3, 2017 at 3:36

3

Solved

I have a 100 digit number stored as string. I want to divide this number with an integer less than 10. How do I efficiently divide a big integer stored as a string with an integer?
Gader asked 4/7, 2014 at 18:41

3

Solved

I tried a recursive factorial algorithm in Rust. I use this version of the compiler: rustc 1.12.0 (3191fbae9 2016-09-23) cargo 0.13.0-nightly (109cb7c 2016-08-19) Code: extern crate num_bigint;...
Eosin asked 3/10, 2016 at 21:25

2

Solved

I'm trying to Hash a BigInteger/BigNum and I'm getting different results in Android/iOS. I need to get the same Hash result so that both the apps work as per the SRP protocol. On closer inspection ...
Peggiepeggir asked 18/8, 2016 at 12:50

6

Solved

My understanding is that many public key cryptographic algorithms these days depend on large prime numbers to make up the keys, and it is the difficulty in factoring the product of two primes that ...

6

Solved

In Haskell, what is the difference between an Int and an Integer? Where is the answer documented?
Stogy asked 7/8, 2010 at 5:52

1

I need to calculate result = (dividend * factor) / divisor where dividend: full range of int64_t values factor: either a full range of uint32_t values or as a special case 2^32 divisor: positiv...
Mincemeat asked 28/12, 2015 at 18:35

3

Solved

I'm trying to use the Num module in OCaml (bignums and big fractions). Some things seem to be working, while others seem not to, and I'm not able to generate a single, complete example. For instanc...
Lapoint asked 14/6, 2015 at 13:52

1

Solved

I am trying to convert a string p_str representing a big integer to a BIGNUM p using the OpenSSL library. #include <stdio.h> #include <openssl/bn.h> int main () { /* I shortened the...
Inexplicit asked 6/5, 2015 at 13:0

© 2022 - 2024 — McMap. All rights reserved.