First  |  Prev |  Next  |  Last
Pages: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
But adding two extra digits of precision gives -937566.236469986849
When you round to 11 decimal places, sure, you'll get -937566.23646998685. But if you round to 12, you'll get -937566.236469986849. (Beware: You can see the latter on gcc, which prints all the digits -- but Visual C++ just adds 0s with each additional place: 85, 850, 8500, ...). To understand what's happening you... 27 Jun 2010 10:37
I think GCC gets it right
I got the same results in C using printf with "%0.10f", which prints 16 significant digits: -937566.2364699869 in Visual C++ and -937566.2364699868 in gcc on Linux. I checked to make sure both were converting to the same double value, since that could explain the difference (If I may plug my own articles here, for... 26 Jun 2010 16:18
Accessor Functions (getter) for C String (Character Array) Members
red floyd wrote: On Jun 24, 4:03 am, "Martin B." <0xCDCDC...(a)gmx.at> wrote: Leading underscores in names are reserved in C/C++ Consider naming your members "m_isbn" or "isbn_" or maybe just "isbn". Not quite. Leading underscores in names are reserved in the *global* namespace in C++ (note ... 25 Jun 2010 04:24
Is it legal to use maps with refrences ?
Hello My compiler complains if I try to declare std::map<unsigned, RECT const &>::iterator it in the argument list for a function declaration. So I would like to know if it is legal to declare such a container. I understand that operator [] can not possibly work on such a map, because the operator c... 26 Jun 2010 04:22
Why is the return type of count_if() "signed" rather than "unsigned"?
* Pedro Lamar�o, on 24.06.2010 12:59: Daniel Kr�gler wrote: [1] Interestingly the original inability to express the return type of count and count_if was the actual reason to invent the iterator_traits. Looking backward it is amusing to observe that it was considered as less relevant to have an un... 27 Jun 2010 10:37
floating point, how many significant figures?
I always thought the answer was 15, assuming IEEE (seems fairly safe to assume that these days for all but some esoteric embedded environments). Then I came across a C++ program that requires 16. And with Visual Studio it seems to work. Then I recompiled it with GCC and spotted several differences. All the program ... 30 Jun 2010 03:14
Accessor Functions (getter) for C String (Character Array) Members
On 23 Jun., 16:08, CoryG89 <cory...(a)gmail.com> wrote: Ok, so I am working on this for school. I am building a model business application in the console using C++. The application is modeled as a database/cashier program. I have a class called BookData that is supposed to hold a number of character a... 24 Jun 2010 20:49
const in C++
Please help me with this. Sample 1 compiles but Sample 2 throws error. I am not able to reason why SAMPLE 1 //const int i[] = {10,20,30,40,50}; //float f[i[2]]; int main() { const int i[] = {10,20,30,40,50}; float f[i[2]]; } SAMPLE 2 const int i[] = {10,20,30,40,50}; float f[... 24 Jun 2010 20:49
Accessor Functions (getter) for C String (Character Array) Members
Ok, so I am working on this for school. I am building a model business application in the console using C++. The application is modeled as a database/cashier program. I have a class called BookData that is supposed to hold a number of character arrays and a few other variables. Here are my private members: ... 24 Jun 2010 06:20
Why is the return type of count_if() "signed" rather than "unsigned"?
On 23 Jun., 01:32, xmllmx <xml...(a)gmail.com> wrote: As we know, count_if() will never return a negative number. So, it seems evident that the return type of count_if() should be "unsigned integral type" rather than existing "signed integral type". I agree, from the perspective of an algorithm without any r... 24 Jun 2010 19:42
First  |  Prev |  Next  |  Last
Pages: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24