![](/img/trans.png)
[英]How can configure linux routing to send packets out one interface, over a bridge and into another interface on the same box
[英]configure linux out streams
Linux中存在一個問題,它具有0
和-0
。 這是由於浮點數等原因。我想始終忽略-
之前的0
。
有沒有一種方法可以配置“出流”(到文件)或有效的IDE /編輯器?
謝謝
如果使用的是C ++,則可以創建自己的流格式化程序專業化:
就像是
class my_ostream : public std::ostream {
public:
my_ostream& operator<<( float f ) {
std::ostrstream oss;
oss << f;
if( oss.str() == "-0" ) f = fabs(f);
*this->std::ostream << f;
return *this;
}
};
您可能需要將格式從* this復制到ostringstream。
請注意,我已經創建了包裝器類型。 您也許可以簡單地為
std::ostream& operator(<< std::ostream& os, float f )
同樣適用於雙打和其他浮動類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.