// Samy1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "math.h"
using namespace std;

int main()
{
    float c; 
    c = log10(100.0)* 10 ;
    cout<<c;
    int a;
    cin>>a;
    return 0;
}

Hi All,
I tried above program in VC6, and compiled fine in both debug and release mode,but i am getting different results in both mode.
i.e., log10(100.0) * 10 = 20 (debug mode)
log10(100.0)*10 = log101000= 3 (release mode)
please clarify me.

thanks
Samy

Could probably be a bug with the compiler. I can't think of anything else. I'm running on VS 2008 and I get consistent result for both builds as 20.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.