Questions tagged [boost-multiprecision]

Boost library for numeric types with arbitrary precision.

The Boost Multiprecision library is a C++ template library that allows the use of numeric types with a greater precision than built-in types. It has templates for integer and floating-point types, and can work with other libraries like and .

Documentation is available on the Boost website.

90 questions
0
votes
1 answer

Proof that user compressed public key corresponds the curve equation (secp256k1)

I am trying to check if some compressed public key corresponds to an elliptic curve equation (secp256k1). As far as I know it should be valid once the following equation is fulfill y^2 = x^3 + ax + b or y^2 % p = (x^3 +ax +b) % p. Supposing that I…
0
votes
0 answers

Arbitrary multiprecision inside the integrand of a GSL monte carlo integration

My aim is to use GSL monte carlo integration for an integrand in which an arbitrary multiprecision library (Boost) is used. I decided to use an arbitrary multiprecision library because the integral had difficulties to reach convergence. This is the…
0
votes
1 answer

how do i convert a 256bit integer from the boost multiprecision library to a string

How would I convert a boost::multiprecision::int256_t type variable into a string for example string string1 = "12345"; boost::multiprecision::int256_t int1 (string1); boost::multiprecision::int256_t int2 = int1 + 5 string string2; // how do i make…
user17231236
  • 13
  • 1
  • 3
0
votes
0 answers

Boost.QVMs 'normalized()' for quaternions doesn't work with Boost.Multiprecision

I'm using Boost.QVM and boost::multiprecision::cpp_dec_float_50 as my scalar for my quaternion. I tried my program with double instead of boost::multiprecision::cpp_dec_float_50 and it worked, so I believe it is the cause of the problem. #include…
orfvl
  • 111
  • 5
0
votes
0 answers

Vectors and boost::multiprecision::mpq_rational in Rcpp

I am a C++ beginner hoping to find some help here. To motivate my question, I wish to write a function that performs convolutions in C++ via either infinite precision or rational arithmetic. Since I wish to call this function from R (via Rcpp), I…
0
votes
0 answers

use boost::polygon with boost::multiprecision

I'm trying to use boost::polygon with boost::multiprecision to calculate polygon differences but no matter how i try to combine the two, i'm always getting compiler errors like assigning to 'long double' from incompatible type…
jesses
  • 559
  • 3
  • 15
0
votes
0 answers

Can't include

I have a simple program where I'd like to use . ex.xpp: #include #include int main() { std::cout << "Hello, World!" << std::endl; return 0; } However, when I try to…
0
votes
1 answer

Setting bits on cpp_int

Silly question but, does setting bits on a cpp_int from the boost library work the same as normal numbers? For instrance, I tried to set some bits on a number like so: vector bits; //contains…
0
votes
2 answers

Overload boost::multiprecision::pow with fixed precision

The following code #include #include typedef boost::multiprecision::number, boost::multiprecision::et_off> float_50; int…
algae
  • 407
  • 4
  • 15
0
votes
1 answer

Getting constant too big error while using boost library (cpp_int)

As I am trying to work with big integers I installed boost library but when I try to debug I get constant too big error while I think cpp_int can handle it right? could you please take look at my code and error? here is the error: Error C2177 …
hmffa
  • 5
  • 3
0
votes
1 answer

Boost's multiprecision to emulate low-accuracy fast floats

I have an stm32-F1 processor that is very slow with float operations and I have some libraries from an F7 processor that uses a lot of floats. I would like to use this libraries on my poor F1 so I was thinking of a way to make as less tweaks as I…
Spyros Mourelatos
  • 484
  • 1
  • 8
  • 19
0
votes
1 answer

Boost C++ how to output all digits of float values without the exponent character?

#include #include #include using boost::multiprecision::number; using boost::multiprecision::cpp_dec_float; using…
Huy Le
  • 1,439
  • 4
  • 19
0
votes
1 answer

how to print boost multiprecision 128 bit unsigned integer

I want to print integer value that converted from hexadecimal value but i only could print hexadecimal value. #include #include using namespace boost::multiprecision; cpp_int …
Serhan Erkovan
  • 481
  • 4
  • 18
0
votes
0 answers

How to perform Modulo of boost::cpp_dec_float_50 and boost::int1024_t Data Types?

I'm trying to perform a modulo operation on two numbers. One is a cpp_dec_float_50 type (decimal) number, and the other is a int1024_t type number - both supplied by the Boost Multiprecision C++ library. I've tried using the % operator, and the…
Zaxter5
  • 57
  • 1
  • 2
  • 9
0
votes
1 answer

Load 1024bit P and G value defined in the RFC5114 into boost uint1024

I am trying to implement a diffie-hellman key exchange system. For my P and G value, I plan to use the one defined in the RFC5114 2.1. So I have the following code: #Code #include #include
kc12345
  • 67
  • 9