CORE: Accelerate writing to a stream if precision <= 17

This commit is contained in:
Andreas Fabri 2024-05-02 17:22:56 +01:00
parent 94d45552bc
commit 2266c6d01f
1 changed files with 5 additions and 1 deletions

View File

@ -346,7 +346,11 @@ public:
/// I/O Stream operator<<
inline std::ostream& operator<<(std::ostream& o, const Expr& e) {
o << *(const_cast<ExprRep*>(&e.getRep()));
if (o.precision() > 17) {
o << *(const_cast<ExprRep*>(&e.getRep()));
} else {
o << e.doubleValue();
}
return o;
}
/// I/O Stream operator>>