File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding long and float

 
saxena neera
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was developing the below code....




Both results in output float, float , what the reason behind that please advise and how can I call double please advise thanks a lot..!
 
Winston Gutkowski
Bartender
Pie
Posts: 9477
50
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
saxena neera wrote:Both results in output float, float , what the reason behind that please advise and how can I call double please advise thanks a lot..!

I suggest you look here.

Winston
 
Vinod Vijay
Ranch Hand
Posts: 146
Java Tomcat Server Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
saxena neera wrote:i was developing the below code....





Both results in output float, float , what the reason behind that please advise and how can I call double please advise thanks a lot..!


Both are returning different string objects because you are returning string only. Method parameters have nothing to do here in this case. they are not doing any job. Period
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinod Vijay wrote:Method parameters have nothing to do here in this case. they are not doing any job.

I think you misunderstood the issue at hand. It is entirely about method parameters, and in particular, their type. It hinges on the fact that the parameter that fits most closely is chosen, and for a long, that is float, not double.

One way to achieve this would to call the method like this: m((double) b1)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic