diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2017-01-12 18:02:46 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-06-14 08:21:17 +0000 |
commit | 94f565a00cbc8d779251355cdb94704277711da7 (patch) | |
tree | 477bc020099d5dc60f1d0f7f5398afbda830e48e /examples/charts/qmloscilloscope | |
parent | 81d0c42c7e4b781365556e1e8d1c8de1e592ae47 (diff) |
Be (somewhat more) consistent about the value of pi
Use M_PI in C++ and Math.PI in JavaScript (including QML).
Use qmath.h's value for M_PI where we can't avoid an explicit value.
Task-number: QTBUG-58083
Change-Id: I80c81444c1867f8f0c07f192fa68de933f48bbc4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'examples/charts/qmloscilloscope')
-rw-r--r-- | examples/charts/qmloscilloscope/datasource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/charts/qmloscilloscope/datasource.cpp b/examples/charts/qmloscilloscope/datasource.cpp index 3654dec0..f687beb0 100644 --- a/examples/charts/qmloscilloscope/datasource.cpp +++ b/examples/charts/qmloscilloscope/datasource.cpp @@ -82,7 +82,7 @@ void DataSource::generateData(int type, int rowCount, int colCount) switch (type) { case 0: // data with sin + random component - y = qSin(3.14159265358979 / 50 * j) + 0.5 + (qreal) rand() / (qreal) RAND_MAX; + y = qSin(M_PI / 50 * j) + 0.5 + (qreal) rand() / (qreal) RAND_MAX; x = j; break; case 1: |