Click or drag to resize
sqx

SQXBin Method

Function [float] Bin([bigint] N, [bigint] K)
(Mathematics)

Namespace:  sqx
Assembly:  SQX (in SQX.dll) Version: 1.0.2.6 (1.0.2.6)
Syntax
C#
public static SqlDouble Bin(
	SqlInt64 N,
	SqlInt64 K
)

Parameters

N
Type: System.Data.SqlTypesSqlInt64
[bigint]
K
Type: System.Data.SqlTypesSqlInt64
[bigint]

Return Value

Type: SqlDouble
[float]
Remarks
Binomial coefficient (ⁿₖ) function.
Support: N, K [+/-]
Examples
SQL
DECLARE @N bigint = 155, @K bigint = 5
SELECT sqx.Bin(@N, @K) Bin
, sqx.BinSign(@N, @K) * EXP(sqx.LogBin(@N, @K)) BinFromLogBin
, sqx.BinSign(@N, @K) [Sign]
, sqx.LogBin(@N, @K) LogBin
, LOG(NULLIF(sqx.Bin(@N, @K), 0)) [LOG(Bin)]
/*
Bin               BinFromLogBin     Sign   LogBin            LOG(Bin)
----------------- ----------------- ------ ----------------- -----------------
698526906         698526906         1      20.3644842556045  20.3644842556045*/
See Also