cardycakes
cardycakes

Reputation: 435

How do I perform this arithmatic in a more elegant manner?

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

How do I simplify the / roomSize / roomSize ?

Upvotes: 0

Views: 66

Answers (2)

Wayne Yu
Wayne Yu

Reputation: 1

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

Upvotes: 0

Eran
Eran

Reputation: 393781

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

Upvotes: 3

Related Questions