• Post Reply Bookmark Topic Watch Topic
  • New Topic

Double literal  RSS feed

 
Ganesha Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the floating point literal such as 3.21 always of the type double by default.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Language Specification.
3.10.2 Floating-Point Literals
[ May 15, 2006: Message edited by: wise owen ]
 
Ganesha Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The article just describes float and double literals. But it does not say why a literal such as "3.02" is double by default. What is the advantage of having it double.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
more precision.
IEEE floating-point standard.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!