-1

I use int128_t in boost, multiprecision library.

When I write int128_t number = 265252859812191058636308480000000; I have a mistake, that constant is too long.

How can I input 128-bit value correctly? For example:

AF5228967057FE1CB84B92511BE89A47 in int128_t?

arco444
  • 22,002
  • 12
  • 63
  • 67
Sofiia
  • 51
  • 1
  • 6

1 Answers1

0

As @jonathon-reinhart said, a bit of reading the boost documentation will lead you to an answer.

Specifically, http://www.boost.org/doc/libs/1_55_0/libs/multiprecision/doc/html/boost_multiprecision/tut/conversions.html shows how to construct multi precision types from (say) a string.

You can't construct it from a literal, because literals are only built-in types. Unless you are using C++11 and you have a compiler which supports user-defined literal conversions, in which case http://www.boost.org/doc/libs/1_55_0/libs/multiprecision/doc/html/boost_multiprecision/tut/lits.html describes how to use those.

Marshall Clow
  • 15,972
  • 2
  • 29
  • 45