 | smallestFactorSmallestFactor Method (Int32, NullableInt32) |
Get the smallest prime factor of an
Int32.
Namespace:
NumberStone
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic static int SmallestFactor(
this int value,
Nullable<int> start = null
)
Parameters
- value
- Type: SystemInt32
The number to factorize. - start (Optional)
- Type: SystemNullableInt32
The smallest prime to check or to check all of them.
Return Value
Type:
Int32The smallest prime number after
start that divides
value, or
value if none found.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Int32. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also