This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

any body who use jscience Fixed point maths

 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks,
I am using jscience Fixed point math class and want to increment in integer on keyrepeated pls see the code
if(key == RIGHT)
{
n = MathFP.toFP(0);
m = MathFP.toFP("0.2");
n = n + m;
System.out.println(MathFP.toString(n));
}
this always give me 0.1999 any solution or any other way to do this pls help
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks

sorry for this code problem is solved it was a logical problem.
but now there is new problem
when i get incremented 'n' and add this in image 'x' axis it won't incremented properly
image_x + MathFP.toFP(n);
pls help
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was a discussion in the directions to that library that to use some functions you have to do osme manipulation of numbers before using a particular function
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!