I want to print out the result of my output without a decimal. Essentially, like an int. I was looking into bit shifting, but ran into a dead end. It seems so simple, yet I've struggled for three days.
std::cout << std::fixed << std::setprecision(100) << number << std::endl;
I like that you are using std:: in front of cout, but it really needs to be used everywhere if you use it in even one place. Otherwise I would say not to use it at all. (I recommend using it everywhere :)
noshowpoint does not do what you fondly believe it does.
I did make an assumption (based on the name of the function) that the decimal point would not be shown for numbers less than 0. If that is not the case, could the noshowpoint page be edited to show an example of a number less than 0?
So what I see is that it really only truncates any zeros to the right of decimal, and if no other number remains to the right of the decimal, the decimal is also clipped. If a number is less than zero, the "0." still remains on the left of the number. My assumpiton was incorrect.
So yeah, it seems useless for the OP. Time to go take my Ritalin.
My gratitude to the solutions given. They were excellent and make me look into stringstream functionality more. Ostensibly I'm new at this and will get my coding input up to par next time I post something.
Cire I'm using your version of this. It's excellent. I also want it to print 0 for log(1), but I want to figure that one out for myself as I need to learn this.