Skip to content

Instantly share code, notes, and snippets.

@fitomad
Last active January 14, 2016 09:33
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 fitomad/5d585332a7384a5a8f85 to your computer and use it in GitHub Desktop.
Save fitomad/5d585332a7384a5a8f85 to your computer and use it in GitHub Desktop.
Tontadas
///
/// La aportación de **Louis Van Gaal**
/// al desarrollo del lenguaje Swift.
///
/// La explicación en este vídeo de [Youtube](https://www.youtube.com/watch?v=Od5PQoRr7hU)
///
extension SignedIntegerType
{
/**
Convierte un número entero en negativo
*/
public mutating func siempreNegativaNuncaPositiva() -> Void
{
if self > 0
{
self *= -1
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment