mirror of
https://github.com/louisrubet/rpn
synced 2024-12-30 10:23:32 +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)
|
||||
{
|
||||
//TODO please NOOO
|
||||
char buffer[512];
|
||||
|
||||
switch(_type)
|
||||
|
@ -373,11 +372,11 @@ void object::show(ostream& stream)
|
|||
switch(((number*)this)->_representation)
|
||||
{
|
||||
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;
|
||||
break;
|
||||
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;
|
||||
break;
|
||||
case number::bin:
|
||||
|
|
Loading…
Reference in a new issue