Skip to content

Commit

Permalink
fix: correctly calculate number of steps in derivative example
Browse files Browse the repository at this point in the history
  • Loading branch information
mimizh2418 committed Nov 30, 2024
1 parent 2305e09 commit de1f9b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/derivatives/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {
constexpr double max = 1.0;
constexpr double step = 0.1;

std::array<double, static_cast<int>(max - min / step) + 1> x_vals{};
std::array<double, static_cast<int>((max - min) / step) + 1> x_vals{};
for (unsigned int i = 0; i < x_vals.size(); i++) {
x_vals[i] = min + i * step;
}
Expand Down

0 comments on commit de1f9b9

Please sign in to comment.