java – division double android

My department on Android has a problem:

    double test= 100/ 1280;
    double test2 = 0.2354;
    System.out.println(test);
    System.out.println(test2);

I have

0.0
0.2354

I want

0.078125
0.2345

thank you

resolvent:

Try this

 double test= (double) 100/ 1280;

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>