# IntegerExtensionMethods class

Namespace: [Grasshopper2.Extensions](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.extensions.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class IntegerExtensionMethods
```

Extension methods for various integer types.

## Methods

- [ArrayTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/arrayto.md): (5 overloads, static) Create an array from this integer to another.
- [Average](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/average.md): (static) Compute the mean (average) of a collection of integers. This method is designed to work with a large number of integers or very large integers. Essentially, if you're certain that the sum of all values doesn't exceed Int32.MaxValue, there are faster ways to compute the average.
- [Clip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/clip.md): (4 overloads, static) Limit an integer to a range.
- [DigitCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/digitcount.md): (static) Returns the number of digits of a BigInteger value, ignoring any sign. Read off the logarithm rather than from an expansion, so it costs a few microseconds no matter how large the value is. Only a logarithm which lands within rounding distance of a whole number has to be settled exactly, which is to say only a value within a hair of a power of ten.
- [Digits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/digits.md): (static) Count the number of base-10 digits required to represent this number. Note that this does not include the sign.
- [DivideAsDecimal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/divideasdecimal.md): (static) Divide two big integers to yield a decimal floating point result. This method is slow but generally speaking more accurate than converting the big integer into doubles prior to division.
- [ExtendSequence](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/extendsequence.md): (static) Attempt to continue an array of integers.
- [FindCycle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/findcycle.md): (2 overloads, static) Determine whether an array of integers contains repeating elements. the last iteration of the cycle may be incomplete.
- [Half](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/half.md): (static) Halves the value and rounds to the nearest whole number.
- [Highest](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/highest.md): (static) Gets the highest number in an array.
- [Interpolate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/interpolate.md): (static) Interpolate between two BigInteger instances.
- [Lowest](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/lowest.md): (static) Gets the lowest number in an array.
- [Map](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/map.md): (static) Apply an indexing map.
- [MarchTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/marchto.md): (4 overloads, static) Enumerate from the current integer to a target integer.
- [OrdinalSuffix](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/ordinalsuffix.md): (static) Get the ordinal suffix ("st", "nd", "rd", or "th") for an integer.
- [Simplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/simplify.md): (2 overloads, static) Same as [IntegerExtensionMethods.Simplify(BigInteger)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/simplify.md), except it returns success and output the 32-bit integer.
- [ToDifferenceArray](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/todifferencearray.md): (static) Create a difference array. This array contains all the values that need to be added to the elements in the original array in order to yield the next element. The difference array will be one element shorter.
- [ToEnglishNumeral](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/toenglishnumeral.md): (static) Convert this integer to english words.
- [ToEnglishOrdinal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/toenglishordinal.md): (static) Convert an integer into an ordinal (first, second, third etc). Integers up to and including 12 are given full words, integers beyond that magnitude are kept as digits with trailing 'st', 'nd', 'rd', 'th' suffixes.
- [ToGrasshopperString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/tograsshopperstring.md): (static) Format a 128-bit Guid using Grasshopper code replacements.
- [ToRomanNumeral](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/toromannumeral.md): (static) Convert an integer to a roman numeral. Only integers between 1 and 3999 are supported, integers outside of that range are returned as arabic numerals.
- [ToShortString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/toshortstring.md): (static) Format a big integer for reading rather than for round tripping. A value of no more than `fullDigits` digits is written out in full; a longer one is cut to its `headDigits` leading digits, followed by a count of the digits left out.
- [ToStringCancellable](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/tostringcancellable.md): (static) Converts a [BigInteger](https://learn.microsoft.com/dotnet/api/system.numerics.biginteger) to its decimal string representation, checking `cancellationToken` between chunks so very large values can be aborted without waiting for completion.
- [With<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/with.md): (static) Add an enum flag.
- [Without<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.integerextensionmethods/without.md): (static) Remove an enum flag.
