我只是写了一个小方法来计算手机短信的页数.我没有选择使用Math.ceil,老实说它似乎非常难看.
这是我的代码:
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String message = "today we stumbled upon a huge performance leak while optimizing a raycasting algorithm. Much to our surprise, the Math.floor() method took almost half of the calculation time: 3 floor operations took the same amount of time as one trilinear interpolation. Since we could not belive that the floor-method could produce such a enourmous overhead, …Run Code Online (Sandbox Code Playgroud)