== Why is this an issue?

Numbers are infinite, but the types that hold them are not. Each numeric type has hard upper and lower bounds. Try to calculate or assign numbers beyond those bounds, and the result will be a value that has silently wrapped around from the expected positive value to a negative one, or vice versa.


== Noncompliant code example

[source,csharp]
----
public int Transform(int value)
{
    if (value <= 0)
    {
        return value;
    }
    int number = int.MaxValue;
    return number + value;  // Noncompliant
}
----

== Compliant solution

[source,csharp]
----
public long Transform(int value)
{
    if (value <= 0)
    {
        return value;
    }
    long number = int.MaxValue;
    return number + value;
}
----


== Resources

include::../common/resources/standards.adoc[]


include::../rspecator.adoc[]
