Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

modulus program

static long factorial(int n)
{
    long M = 1000000007;
 
    long f = 1;
    for (int i = 1; i <= n; i++)
        f = (f*i) % M;  // Now f never can
                        // exceed 10^9+7
    return f;
}
Comment

modulus program

c = 1000000007
( a + b) % c = ( ( a % c ) + ( b % c ) ) % c
( a * b) % c = ( ( a % c ) * ( b % c ) ) % c
( a – b) % c = ( ( a % c ) – ( b % c ) ) % c
 
// below this is not ture statement
( a / b ) % c = ( ( a % c ) / ( b % c ) ) % c
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity c# change animation 
Csharp :: if debug c# 
Csharp :: checking a gamobjects layer 
Csharp :: is number c# 
Csharp :: unity post processing on UI 
Csharp :: unity set sprite image from script 
Csharp :: click in vue 
Csharp :: c# streamwriter add new line 
Csharp :: Edit file C# 
Csharp :: how to locate a specific element in a list c# 
Csharp :: cast char[] to string c# 
Csharp :: how to get file type from base64 in c# 
Csharp :: how to make player movement in unity 2d 
Csharp :: ray casting unity 
Csharp :: unity add button 
Csharp :: if c# 
Csharp :: how to make a string a list of characters c# 
Csharp :: how to pass id from view to controller in asp.net core 
Csharp :: asp.net format datetime 
Csharp :: order 3 integers in c# 
Csharp :: get int value from enum c# 
Csharp :: c# combobox lock edit 
Csharp :: c# split large file into chunks 
Csharp :: same click event diffrenet buttonms c# 
Csharp :: string in c# 
Csharp :: c# async constructor 
Csharp :: max index array c# 
Csharp :: Printing pattern in c# 
Csharp :: c# callback param 
Csharp :: c# remove invalid directory characters 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =