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