How does C++ work with large numbers?
I have a code that tries to solve an integral of a function in a given interval numerically, using the method of Trapezoidal Rule (see the formula in https://dev.to/juanroalvarado/functional-approach-to-trapezoidal-rule-integration-m68 ), now, for the function sin(x) in the interval [-pi/2.0,pi/2.0], the integral is waited to be zero. In this case, I take the number of partitions 'n' equal to 4. The problem is that when I have pi with 20 decimal places it is zero, with 14 decimal places it is 8.72e^(-17), then with 11 decimal places, it is zero, with 8 decimal places it is 8.72e^(-17), with 3 decimal places it is zero. I mean, the integral is zero or a number near zero for different approximations of pi, but it doesn't have a clear trend. I would appreciate your help. Code: https://code.sololearn.com/ca9a21A7A17A