Int64 - IsMultipleOf
An Int64 extension method that query if '@this' is multiple of.
public static void Main() { Int64 factorNumber = 71; Console.WriteLine("Multiple of {0} are:\n", factorNumber); for (Int64 val = 1; val <= 1000; val++) { // C# Extension Method: Int64 - IsMultipleOf if(val.IsMultipleOf(factorNumber)) { Console.WriteLine(val); } } }
View Source
using System; public static partial class Extensions { /// <summary> /// An Int64 extension method that query if '@this' is multiple of. /// </summary> /// <param name="this">The @this to act on.</param> /// <param name="factor">The factor.</param> /// <returns>true if multiple of, false if not.</returns> public static bool IsMultipleOf(this Int64 @this, Int64 factor) { return @this%factor == 0; } }