byte [] getFraction(int s)
{
byte t[] = new byte[6];
// 0 1 2 3 4 5
int i,j,k;
int m = s;
for(i = 0;m > 255;i++)
m -= 255;
System.out.println("value of s in getFraction = " + m);
t[1] = (byte)m;
System.out.println("value of t[1] in getFraction = " + (int)t[1]);
System.out.println("value of s in (byte)s = " + (byte)m);
if(i > 255)
{
t[0] = 0;
for(j = 0;i > 255;j++)
i -= 255;
t[3] = (byte)i;
if(j > 255)
{
t[2] = 0;
for(k = 0;j > 255;k++)
j -= 255;
t[5] = (byte)j;
t[4] = (byte)k;
}
else
t[2] = (byte)j;
}
else
t[0] = (byte)i;
return t;
}
this code has a problem in line 10 here value of m is less than 255 but still
t is having a value of -39 plz help me
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).