error -1.#IND00 in vc++2010
-
-
hello; I tried to write a function that calculates the harmonic average as follows:
long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0;ithe console I have this error -1.#IND00 .
what is the origin of this error ?
cordialywhat are the values of 'l' and 's', when you hit this line:
return l/s;
-
hello; I tried to write a function that calculates the harmonic average as follows:
long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0;ithe console I have this error -1.#IND00 .
what is the origin of this error ?
cordialyI think you should check address of pointer and length of array
-
hello; I tried to write a function that calculates the harmonic average as follows:
long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0;ithe console I have this error -1.#IND00 .
what is the origin of this error ?
cordialyI have checked on visual studio 2010 , you can check again
#include
#include
using namespace std;long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0; i3.19262
Press any key to continue . . .Thanks
Thong Le Trung -
hello; I tried to write a function that calculates the harmonic average as follows:
long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0;ithe console I have this error -1.#IND00 .
what is the origin of this error ?
cordialyI am sorry , I see error for you . I have a example , i hope this example will help you. What will be output of the following program?
#include
int main(){
float a=0.7;d
if(a<0.7){
printf("C");
}
else{
printf("C++");
}
return 0;
}EXPLANATION Output: Turbo C++ 3.0: c Turbo C ++4.5: c Linux GCC: c Visual C++: c Explanation: 0.7 is double constant (Default). Its binary value is written in 64 bit. Binary value of 0.7 = (0.1011 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011 ) Now here variable a is a floating point variable while 0.7 is double constant. So variable a will contain only 32 bit value i.e. a = 0.1011 0011 0011 0011 0011 0011 0011 0011 while 0.7 = 0.1011 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011.... It is obvious a < 0.7
-
I have checked on visual studio 2010 , you can check again
#include
#include
using namespace std;long double Harmonique(long double *t,int l)
{
long double s=0.0;
for(int i=0; i3.19262
Press any key to continue . . .Thanks
Thong Le Trung -
I am sorry , I see error for you . I have a example , i hope this example will help you. What will be output of the following program?
#include
int main(){
float a=0.7;d
if(a<0.7){
printf("C");
}
else{
printf("C++");
}
return 0;
}EXPLANATION Output: Turbo C++ 3.0: c Turbo C ++4.5: c Linux GCC: c Visual C++: c Explanation: 0.7 is double constant (Default). Its binary value is written in 64 bit. Binary value of 0.7 = (0.1011 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011 ) Now here variable a is a floating point variable while 0.7 is double constant. So variable a will contain only 32 bit value i.e. a = 0.1011 0011 0011 0011 0011 0011 0011 0011 while 0.7 = 0.1011 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011.... It is obvious a < 0.7