Dhairya Malhotra 7 роки тому
батько
коміт
199fbc7334
2 змінених файлів з 7 додано та 6 видалено
  1. 2 1
      include/sctl/math_utils.hpp
  2. 5 5
      include/sctl/math_utils.txx

+ 2 - 1
include/sctl/math_utils.hpp

@@ -38,9 +38,10 @@ typedef SCTL_QUAD_T QuadReal;
 
 QuadReal atoquad(const char* str);
 
-std::ostream& operator<<(std::ostream& output, const QuadReal q_);
 }
 
+inline std::ostream& operator<<(std::ostream& output, const sctl::QuadReal q_);
+
 #endif  // SCTL_QUAD_T
 
 #include SCTL_INCLUDE(math_utils.txx)

+ 5 - 5
include/sctl/math_utils.txx

@@ -218,11 +218,13 @@ inline QuadReal atoquad(const char* str) {
   return sign * val;
 }
 
-inline std::ostream& operator<<(std::ostream& output, const QuadReal q_) {
+}  // end namespace
+
+inline std::ostream& operator<<(std::ostream& output, const SCTL_NAMESPACE::QuadReal q_) {
   // int width=output.width();
   output << std::setw(1);
 
-  QuadReal q = q_;
+  SCTL_NAMESPACE::QuadReal q = q_;
   if (q < 0.0) {
     output << "-";
     q = -q;
@@ -235,7 +237,7 @@ inline std::ostream& operator<<(std::ostream& output, const QuadReal q_) {
   }
 
   int exp = 0;
-  static const QuadReal ONETENTH = (QuadReal)1 / 10;
+  static const SCTL_NAMESPACE::QuadReal ONETENTH = (SCTL_NAMESPACE::QuadReal)1 / 10;
   while (q < 1.0 && abs(exp) < 10000) {
     q = q * 10;
     exp--;
@@ -261,6 +263,4 @@ inline std::ostream& operator<<(std::ostream& output, const QuadReal q_) {
   return output;
 }
 
-}  // end namespace
-
 #endif  // SCTL_QUAD_T