Tech Support banner

Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter #1
#include <iostream.h>
#include <conio.h>

void main ()
{
double a;

clrscr ();
a= 1.1;
// cout <<" Input a : ";
// cin >> a;

a=(a-(int)a)*10;
cout <<" Result a : " << a-(int)a;

getch();
}


==> a = 8.881784E-16 (????) :4-dontkno

If you can, please mail for me . Thanks
 

·
Registered
Joined
·
1,097 Posts
First off, you didn't even provide a valid question to your problem. You merely tossed up some code and expected us to figure out what it is that you want done. You then want someone to email you the answer when that is clearly not what the forums are meant for.

In other words, show some common courtesy if you expect people to help you.
 

·
Registered
Joined
·
2 Posts
Discussion Starter #3
My english isn’t well so I wrote it too short … I’m very sorry. :sad:
So I present it by ….
{
.......
Double a = 1.1 ; // This’s an example.
a=(a-(int)a)*10; // The result’s 1 . It’s right
cout <<" Result a : " << a-(int)a; // But this’s a = 8.881784E-16 instead of a=0
……
}

Thank you very much.
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top