#TC1017 #wsq14: Calculating e

This is my code for WSQ14. I had some problems finding out how to truncate the decimals, because the function I was using rounded them, so instead I used strings… I converted the double variable to a string, I applied .substr, and then I converted back to double. This way, decimals were truncated in the precision given, instead of being rounded.

Here is the code:

https://github.com/JPBarberena/Codes/blob/master/wsq14.cpp

CC BY 4.0 #TC1017 #wsq14: Calculating e by Juan Pablo Barberena is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.