Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created June 6, 2018 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/9fb92ba7424057adddf12837c6845264 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/9fb92ba7424057adddf12837c6845264 to your computer and use it in GitHub Desktop.
class Circle {
fun calculateArea(radius: Double): Double {
require(radius > 0, { "Radius must be greater than 0" })
return Math.PI * Math.pow(radius, 2.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment