SqrtMath
The SqrtMath library facilitates fixed-point square root calculations using the Babylonian method.
sqrt
Calculate the square root of an unsigned 256-bit integer using fixed-point arithmetic and the Babylonian method.
Parameters:
Name | Type | Description |
---|---|---|
x | uint | Unsigned 256-bit integer for which the square root is calculated. |
Return Values:
Name | Type | Description |
---|---|---|
z | uint | Unsigned 256-bit integer representing the square root of x. |
Numerous instances of the sqrt
function are employed throughout Dyson Finance, necessitating the calculation of the square root of a uint256 number. This includes various functions within the following contracts:
Last updated