Showing the changes to Spectacle/SpectacleBase.cpp (1 of 4 files). Show all
Unified · Split
| @@ -20,6 +20,8 @@ · 19 unmodified lines | ||
| 20 | 20 | //#define CHECK_BINGROUPS |
| 21 | 21 | |
| 22 | 22 | #include "SpectacleBase.h" |
| 23 | +#define _USE_MATH_DEFINES // for Visual Studio | |
| 24 | +#include <math.h> | |
| 23 | 25 | #include <float.h> |
| 24 | 26 | #include <cstddef> |
| 25 | 27 | |
| @@ -522,7 +524,7 @@ void SpectacleBase::update_bin_groups( · 496 unmodified lines | ||
| 522 | 524 | const int extrabins = (highshelfbin - lowshelfbin) - cntltablen; |
| 523 | 525 | //if (extrabins <= 0) |
| 524 | 526 | //error("%s: program error - contact johgibso@gmail.com", instname()); |
| 525 | − const int nsums = int(sqrt(2 * extrabins) + 2); | |
| 527 | + const int nsums = int(sqrtf(2 * extrabins) + 2); | |
| 526 | 528 | |
| 527 | 529 | // Compute the sum of integers for n in [nsums-2, nsums); |
| 528 | 530 | // formula is the closed-form equation: x = n * (n + 1) / 2. |