📄 o_f_stream.c
字号:
// $Id: o_f_stream.C 2789 2008-04-13 02:24:40Z roystgnr $// The libMesh Finite Element Library.// Copyright (C) 2002-2007 Benjamin S. Kirk, John W. Peterson // This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA// C++ includes// Local Includes#include "o_f_stream.h"/* * This class is only alive when iostream is broken */#ifdef BROKEN_IOSTREAM// the template for realstemplate <typename T>OFStream& OFStream::scientific (const sizetype w, const T r){ libmesh_assert (w < 30); char buf[30]; char format[8]; // form the format for r sprintf (format, "%%%de", w); // form string as desired sprintf (buf, format, r); *this << buf; return *this;}// full specialization in case of complex numbers#if defined(USE_COMPLEX_NUMBERS) template <>OFStream& OFStream::scientific (const sizetype w, const Complex r){ libmesh_assert (w < 30); char buf[60]; char format[16]; // form the format for r sprintf (format, "%%%de %%%de", w, w); // form string as desired sprintf (buf, format, r.real(), r.imag()); *this << buf; return *this;}#endif // if defined(USE_COMPLEX_NUMBERS) //--------------------------------------------------------------// Explicit instantiations for realstemplate OFStream& OFStream::scientific (const sizetype w, const double r);template OFStream& OFStream::scientific (const sizetype w, const float r);#endif // ifdef BROKEN_IOSTREAM
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -