mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-11 16:22:12 +00:00
Fix formatting, spelling
This commit is contained in:
parent
7ce2d39b93
commit
b321a36b7d
19
ZSharp/ZS.h
19
ZSharp/ZS.h
@ -3,6 +3,9 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
std::string ZSContents = R"(
|
std::string ZSContents = R"(
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ↓ DEFAULT BUILTIN ↓
|
||||||
|
|
||||||
// Default variables, can be overwritten
|
// Default variables, can be overwritten
|
||||||
// if re-initialized or changed
|
// if re-initialized or changed
|
||||||
float PI = 3.14159265358979323846264338
|
float PI = 3.14159265358979323846264338
|
||||||
@ -138,22 +141,23 @@ func GetKey(keyName)
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WIP
|
||||||
//func SplitThread(function)
|
//func SplitThread(function)
|
||||||
//{
|
//{
|
||||||
// ZS.System.SplitThread(function)
|
// ZS.System.SplitThread(function)
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//Function made by Kaputchino
|
|
||||||
|
|
||||||
//return the number of combinaison
|
//////////////////////////////////////////////////////
|
||||||
|
// ↓ MADE BY KAPUTCHINO ↓
|
||||||
|
|
||||||
|
// Return the number of combinations
|
||||||
func Comb(n, r)
|
func Comb(n, r)
|
||||||
{
|
{
|
||||||
return Perm(n ,r) / Fac(r)
|
return Perm(n, r) / Fac(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
//return the factorial of a number
|
// Return the factorial of a number
|
||||||
|
|
||||||
func Fac(x)
|
func Fac(x)
|
||||||
{
|
{
|
||||||
int r = 1
|
int r = 1
|
||||||
@ -164,8 +168,8 @@ func Fac(x)
|
|||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
//return exp(x) by using the taylor method, not extremly accurate
|
|
||||||
|
|
||||||
|
// Return exp(x) by using the taylor method, not extremly accurate
|
||||||
func TaylorExp(x)
|
func TaylorExp(x)
|
||||||
{
|
{
|
||||||
float sum = 0
|
float sum = 0
|
||||||
@ -182,8 +186,7 @@ func TaylorExp(x)
|
|||||||
return sum
|
return sum
|
||||||
}
|
}
|
||||||
|
|
||||||
//return the number of permutation
|
// Return the number of permutations
|
||||||
|
|
||||||
func Perm(n, r)
|
func Perm(n, r)
|
||||||
{
|
{
|
||||||
if n < 0
|
if n < 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user