Macaulay2 Engine
Loading...
Searching...
No Matches

◆ output()

std::ostream & mpfr::mpreal::output ( std::ostream & os) const
inline

Definition at line 1917 of file mpreal.h.

1918{
1919 std::ostringstream format;
1920 const std::ios::fmtflags flags = os.flags();
1921
1922 format << ((flags & std::ios::showpos) ? "%+" : "%");
1923 if (os.precision() >= 0)
1924 format << '.' << os.precision() << "R*"
1925 << ((flags & std::ios::floatfield) == std::ios::fixed ? 'f' :
1926 (flags & std::ios::floatfield) == std::ios::scientific ? 'e' :
1927 'g');
1928 else
1929 format << "R*e";
1930
1931 char *s = NULL;
1932 if(!(mpfr_asprintf(&s, format.str().c_str(),
1933 mpfr::mpreal::get_default_rnd(),
1934 mpfr_srcptr())
1935 < 0))
1936 {
1937 os << std::string(s);
1938 mpfr_free_str(s);
1939 }
1940 return os;
1941}
::mpfr_srcptr mpfr_srcptr() const
Definition mpreal.h:1767
void size_t s
Definition m2-mem.cpp:271

References get_default_rnd(), mpfr_srcptr(), output(), and s.

Referenced by operator<<, and output().