• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversion rules

 
Richa Jeetah
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Why does int or long get converted to float
although
int is 32 bits
long is 64 bits
and float is only 32 bits
?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because float can correctly represent the magnitude of any int or long, in spite of the fact that some bits of precision are lost.
Its all in the lanquage specification.
Bill
 
Richa Jeetah
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx
will check it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic