如何以更优雅的方式执行此算法?

时间:2014-08-14 20:04:01

标签: java

frequency = ((x * y)) / roomSize / roomSize

如何简化/ roomSize / roomSize

2 个答案:

答案 0 :(得分:3)

frequency = (x * y) / (roomSize * roomSize)

答案 1 :(得分:0)

或者,frequency = x * y * Math.pow(roomSize, -2)