arbitrary-precision Questions
4
Solved
I have a long integer number, but it is stored not in decimal form, but as set of remainders.
So, I have not the N number, but set of such remainders:
r_1 = N % 2147483743
r_2 = N % 2147483713
r...
Waistcoat asked 13/3, 2011 at 1:53
11
What is the best way to handle large numeric inputs in C++ (for example 10^100)?
For algorithms I usually switch over to ruby and I sometimes use strings.
Any other good methods?
Vorous asked 22/9, 2008 at 20:31
3
Solved
I have a large JSON file that contains bigints with their full values--not rounded like JavaScript loves to do by default.
We have a workaround to deal with the bigints in Node.js, but I'm trying t...
Littman asked 21/7, 2020 at 16:24
3
Solved
I am working in R using arbitrary precision arithmetic in the gmp package. This package creates and stores large integers in the bigz form. For example, you can create a vector of arbitrarily large...
Carpetbag asked 1/3, 2020 at 23:9
1
I'm currently doing a primality test on huge numbers (up to 10M digits).
Right now, I'm using a c program using the GMP library. I did some parallelization using OpenMP and got a nice speedup (3.5~...
Fathead asked 25/12, 2021 at 4:14
1
What is the correct scalar type to use in my protobuf definition file, if I want to transmit an arbitrary-precision decimal value?
I am using shopspring/decimal instead of a float64 in my Go code ...
Sewole asked 30/5, 2018 at 19:20
18
What programming languages support arbitrary precision arithmetic and could you give a short example of how to print an arbitrary number of digits?
Stonyhearted asked 27/9, 2008 at 3:7
11
Solved
This is a problem from Project Euler, and this question includes some source code, so consider this your spoiler alert, in case you are interested in solving it yourself. It is discouraged to distr...
Atory asked 11/10, 2013 at 4:11
5
Solved
I am working with huge numbers for website purposes and I need long calculation. When I echo a long number I don't get the correct output.
Example
// A random number
$x = 100000000000000000000000...
Coprology asked 3/2, 2016 at 6:26
2
Solved
With Perl, one could use bignum to set the level of precision for all operators. As in:
use bignum ( p => -50 );
print sqrt(20); # 4.47213595499957939281834733746255247088123671922305
With Rak...
Poona asked 19/8, 2020 at 9:43
2
Solved
What is the most efficient way to compute the product
a1 b2 c3 d4 e5 ...
assuming that squaring costs about half as much as multiplication? The number of operands is less than 100.
Is there a...
Supinator asked 25/10, 2012 at 21:21
2
Solved
I need to be able to make a transaction in redis that does the following:
decrement n value if and only if the result is > 0
otherwise, do nothing
deal with arbitrary precision decimal numbers (I...
Osteoplastic asked 26/4, 2019 at 17:35
2
Solved
The Python/C API manual mentions conversion functions from⁽¹⁾ and to⁽²⁾ void pointers, which seem to be the only way to use arbitrary length python integers in C.
(1) : PyLong_FromVoidPtr() and for...
Lining asked 3/5, 2019 at 11:28
1
I'm trying to use the CAMPARY library (CudA Multiple Precision ARithmetic librarY). I've downloaded the code and included it in my project. Since it supports both cpu and gpu, I'm starting with cpu...
Dioptometer asked 14/3, 2019 at 22:5
2
Arbitary-precision signed integers are almost always implemented using a sign-magnitude representation:
(Java) BigInteger in OpenJDK
(Python) Bigint implementation of the Python built-in int typ...
Chiles asked 28/8, 2018 at 6:18
2
Assume you want to know the first W significant digits of a number, say pi, using vpa. Simply calling vpa with that many digits does not work. Consider the following example with W = 35:
>> ...
Skill asked 4/4, 2018 at 11:11
3
Good afternoon!
I am trying to develop an NTT algorithm based on the naive recursive FFT implementation I already have.
Consider the following code (coefficients' length, let it be m, is an exact...
Windshield asked 21/4, 2012 at 16:36
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
Solved
The question is very simple and direct, but I could not find an answer on the documentation. If I have
mpfr_t a, b;
Can I do something like
mpfr_add(a, a, b, rnd);
This would compute the sum ...
Cordy asked 24/2, 2017 at 10:35
3
Solved
First question ever here, and newbie in both Common LISP and Haskell, please be kind.
I have a function in Common LISP - code below - which is intended to tell whether the area of a triangle is an ...
Mayonnaise asked 6/10, 2016 at 22:51
1
Solved
SHLD/SHRD instructions are assembly instructions to implement multiprecisions shifts.
Consider the following problem:
uint64_t array[4] = {/*something*/};
left_shift(array, 172);
right_shift(arra...
Mccrory asked 1/9, 2016 at 16:31
2
Solved
I need to get the hash of a value with arbitrary precision (from Boost.Multiprecision); I use the cpp_int backend. I came up with the following code:
boost::multiprecision::cpp_int x0 = 1;
const au...
Misspend asked 7/5, 2015 at 9:44
4
Solved
I have a brief question regarding the vpa command one may use to evaluate symbolic expressions in MatLab.
My textbook says the following:
"You need to be careful when you use functions such as sq...
Futurity asked 3/6, 2012 at 18:47
3
Solved
I was doing some calculations for planning an improved implementation of my prime sieve when I noticed that the Libre Office spreadsheet was showing the wrong values for numbers far below 2^53, whi...
Lucarne asked 28/12, 2015 at 19:8
2
Solved
I'm using the Zarith library to do arbitrary-precision rational arithmetic. Suppose I have a rational number q of type Q.t that is the ratio of two big integers (Q is Zarith's arbitrary-precision r...
Pali asked 10/11, 2015 at 6:1
1 Next >
© 2022 - 2024 — McMap. All rights reserved.