posted 14 years ago
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
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
posted 14 years ago
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
MobileBytes blog - Sharing Technology - My Programming Knols