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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

int / float 1

Status
Not open for further replies.

XoFF

Programmer
Jun 22, 2003
23
GB
i want to make the sum of very large numbers. My question is can i use it with a long type? cause now i use a double it works fine but i don't wanna use floats just positive numbers... maybe a long unsigned???

also what is l used for %lf?
ex: scanf("%lf",&getala);
 
> i want to make the sum of very large numbers.
How large are these numbers?
Say 1,000,000,000,000 ?

Integral numbers (int, long etc) are precise, but have a fairly limited range when compared to say a double.

On the other hand, doubles gain a huge amount of range by sacrificing a similarly huge amount of precision - that is, all floats/doubles are approximations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top