Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 15, 2013 00:12
Show Gist options
  • Save Fhernd/5996713 to your computer and use it in GitHub Desktop.
Save Fhernd/5996713 to your computer and use it in GitHub Desktop.
Código fuente sin chequeo de desbordamiento.
class SinOperadorChecked
{
static void Main()
{
// Este ejemplo no produce error en tiempo de compilación.
int diez = 10;
int i = 2147483647 + diez;
// Por defecto, la sentencia anterior no produce ninguna
// excepción en tiempo de ejecución.
Console.WriteLine(i); // El valor calculado es -2.147.483.639
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment