mirror of
https://github.com/github/codeql.git
synced 2025-12-19 02:13:17 +01:00
16 lines
220 B
C#
16 lines
220 B
C#
double reciprocal(double input)
|
|
{
|
|
try
|
|
{
|
|
return 1 / input;
|
|
}
|
|
catch (DivideByZeroException)
|
|
{
|
|
return 0;
|
|
}
|
|
catch (OverflowException)
|
|
{
|
|
return double.MaxValue;
|
|
}
|
|
}
|