Commit 8620d8d1 authored by Jan Dinkelbach's avatar Jan Dinkelbach Committed by Markus Mirz
Browse files

use cout instead of to_string for logging of phasors and complex numbers for better accuracy

parent 04703fd9
......@@ -81,11 +81,15 @@ namespace CPS {
}
static String phasorToString(const Complex& num) {
return std::to_string(Math::abs(num)) + "<" + std::to_string(Math::phaseDeg(num));
std::stringstream ss;
ss << std::defaultfloat << Math::abs(num) << "<" << Math::phaseDeg(num);
return ss.str();
}
static String complexToString(const Complex& num) {
return std::to_string(num.real()) + "+j" + std::to_string(num.imag());
std::stringstream ss;
ss << std::defaultfloat << num.real() << "+j" << num.imag();
return ss.str();
}
static String getCSVColumnNames(std::vector<String> names);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment