Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic