Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double type Assignment problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi ,

I am encountering a queer problem in a sample c program.

main()
{
double fld1;
fld1=2299595420;
Prinf("\n passed field value is %.0f ");
}

It gives an output of value -1995371876. However i want to see the actual value of
2299595420.

This works fine if i cange the value to either 129959520 or increase the value to more than 10 digits. I found that it fails to give the assined value only when there are 10 digits with the starting digit as 2.

Can any of you please help as i am using this in a c routine.

Thanks in advance

Jags
 
Try the statement:
printf("\n passed field value is %10.0f ",fld1);

I hope it works;


hnd
hasso55@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top