[beast] tools/bsefextract.cc: Increase output format precision of some features.
- From: Stefan Westerfeld <stw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [beast] tools/bsefextract.cc: Increase output format precision of some features.
- Date: Sun, 10 Jan 2010 14:06:26 +0000 (UTC)
commit 2d18adb85c46cf5106217a84aea2605acbe81171
Author: Stefan Westerfeld <stefan space twc de>
Date: Sun Jan 10 14:06:09 2010 +0100
tools/bsefextract.cc: Increase output format precision of some features.
Sun Jan 10 14:03:07 2010 Stefan Westerfeld <stefan space twc de>
tools/bsefextract.cc: Use double_to_string() for output formatting
of the --raw-signal and --complex-signal features. This increases
the output precision, and therefore should be appropriate even for
24-bit signals (which the original %f format wasn't).
tools/bsefextract.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index cd513e0..1d8c991 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -596,7 +596,7 @@ struct RawSignalFeature : public Feature
* functions (because then gnuplot couldn't parse it any more).
*/
for (guint i = 0; i < raw_signal.size(); i++)
- fprintf (options.output_file, "%f\n", raw_signal[i]);
+ fprintf (options.output_file, "%s\n", double_to_string (raw_signal[i]).c_str());
}
};
@@ -701,7 +701,8 @@ struct ComplexSignalFeature : public Feature
* functions (because then gnuplot couldn't parse it any more).
*/
for (guint i = 0; i < complex_signal.size(); i++)
- fprintf (options.output_file, "%f %f\n", complex_signal[i].real(), complex_signal[i].imag());
+ fprintf (options.output_file, "%s %s\n", double_to_string (complex_signal[i].real()).c_str(),
+ double_to_string (complex_signal[i].imag()).c_str());
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]