Thread View: pl.comp.lang.c
3 messages
3 total messages
Started by Borneq
Fri, 30 Sep 2016 17:33
Stała liczbowa cpp_int
Author: Borneq
Date: Fri, 30 Sep 2016 17:33
Date: Fri, 30 Sep 2016 17:33
12 lines
1227 bytes
1227 bytes
Używam GCC z CodeBlocks, włączyłem tryb ++11 includuję: #include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_int/literals.hpp> using namespace boost::multiprecision; constexpr cpp_int a = 5742507205757425072053_cppi; wypisuje mi error: unable to find numeric literal operator 'operator""_cppi' Jak można korzystając z cpp_int Boosta używać stałych liczbowych?
Re: Stała liczbowa cpp_int
Author: bartekltg
Date: Fri, 30 Sep 2016 17:50
Date: Fri, 30 Sep 2016 17:50
18 lines
1821 bytes
1821 bytes
On Friday, September 30, 2016 at 7:32:57 PM UTC+2, Borneq wrote: > Używam GCC z CodeBlocks, włączyłem tryb ++11 > includuję: > #include <boost/multiprecision/cpp_int.hpp> > #include <boost/multiprecision/cpp_int/literals.hpp> > > using namespace boost::multiprecision; > constexpr cpp_int a = 5742507205757425072053_cppi; > > wypisuje mi > error: unable to find numeric literal operator 'operator""_cppi' > > Jak można korzystając z cpp_int Boosta używać stałych liczbowych? using namespace boost::multiprecision::literals pzdr bartekltg
Re: Stała liczbowa cpp_int
Author: Borneq
Date: Fri, 30 Sep 2016 18:04
Date: Fri, 30 Sep 2016 18:04
15 lines
1515 bytes
1515 bytes
W dniu 30.09.2016 o 19:50, bartekltg pisze:
> using namespace boost::multiprecision::literals
czepia się, że potrzebuje liczby heksadecymalnej,
"Multi-precision integer literals must be in hexadecimal notation."
a gdy wstawiam na początku 0x wtedy nie przyjmuje
Chyba zrezygnuję ze stałych liczbowych, czy jakoś można konwertować z
ciągów znaków? odwrotnie do std::cout << x << " ";
próba nie działa:
cpp_int a;
a << "5742507205757425072053";
ALE
udało się cpp_int a("5742507205757425072053");
skoro nie ma constexpr to może i przejdzie w VC++
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads