mirror of
https://github.com/github/codeql.git
synced 2026-07-23 04:02:07 +02: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;
|
|
}
|
|
}
|