Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created September 16, 2018 12:57
Show Gist options
  • Save sajjadyousefnia/7e5b38a1eea899dd3438e14259e351b3 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/7e5b38a1eea899dd3438e14259e351b3 to your computer and use it in GitHub Desktop.
fun calCircumference(radius: Double) = (2 * Math.PI) * radius
fun calArea(radius: Double): Double = (Math.PI) * Math.pow(radius, 2.0)
fun circleOperation(radius: Double, op: (Double) -> Double): Double {
val result = op(radius)
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment