mirror of
https://github.com/louisrubet/rpn
synced 2025-01-17 06:12:09 +01:00
#60: mpfr_snprintf instead of mpfr_sprintf
This commit is contained in:
parent
627ae75de9
commit
2d41c64268
1 changed files with 2 additions and 3 deletions
|
@ -364,7 +364,6 @@ struct branch : public object
|
||||||
|
|
||||||
void object::show(ostream& stream)
|
void object::show(ostream& stream)
|
||||||
{
|
{
|
||||||
//TODO please NOOO
|
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
|
||||||
switch(_type)
|
switch(_type)
|
||||||
|
@ -373,11 +372,11 @@ void object::show(ostream& stream)
|
||||||
switch(((number*)this)->_representation)
|
switch(((number*)this)->_representation)
|
||||||
{
|
{
|
||||||
case number::dec:
|
case number::dec:
|
||||||
(void)mpfr_sprintf(buffer, s_mpfr_printf_format.c_str(), ((number*)this)->_value.mpfr);
|
(void)mpfr_snprintf(buffer, sizeof(buffer)-1, s_mpfr_printf_format.c_str(), ((number*)this)->_value.mpfr);
|
||||||
stream<<buffer;
|
stream<<buffer;
|
||||||
break;
|
break;
|
||||||
case number::hex:
|
case number::hex:
|
||||||
(void)mpfr_sprintf(buffer, s_mpfr_printf_format_hex.c_str(), ((number*)this)->_value.mpfr);
|
(void)mpfr_snprintf(buffer, sizeof(buffer)-1, s_mpfr_printf_format_hex.c_str(), ((number*)this)->_value.mpfr);
|
||||||
stream<<buffer;
|
stream<<buffer;
|
||||||
break;
|
break;
|
||||||
case number::bin:
|
case number::bin:
|
||||||
|
|
Loading…
Reference in a new issue