Click or drag to resize

divisibilityDivisibility Method (Int32, Int32)

Get the number of times n can be evenly divided by b.

Namespace:  NumberStone
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static int Divisibility(
	this int n,
	int b
)

Parameters

n
Type: SystemInt32
The dividend.
b
Type: SystemInt32
The divisor.

Return Value

Type: Int32
The maximum power by which you can raise b and still have it divide n.

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).
Remarks
Running time: O( log( log(n)/log(b) ) )
See Also