Skip to content

Commit

Permalink
docs: small update to natspec comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Apr 19, 2021
1 parent 74c85a5 commit 2c93624
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions contracts/PRBMathCommon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity >=0.8.0;

/// @dev Common mathematical functions used in both PRBMathSD59x18 and PRBMathUD60x18. Note that this shared library
/// does not always assume the signed 59.18-decimal fixed-point or the unsigned 60.18-decimal fixed-point
// representation. When it does not, it is annonated in the function natspec documentation.
// representation. When it does not, it is annonated in the function's NatSpec documentation.
library PRBMathCommon {
/// @dev How many trailing decimals can be represented.
uint256 internal constant SCALE = 1e18;
Expand Down Expand Up @@ -249,7 +249,7 @@ library PRBMathCommon {
/// - The result must fit within uint256.
///
/// Caveats:
/// - The body is purposely left uncommented; see the comments in "mulDiv" to understand how this works.
/// - The body is purposely left uncommented; see the NatSpec comments in "PRBMathCommon.mulDiv" to understand how this works.
/// - It is assumed that the result can never be type(uint256).max when x and y solve the following two queations:
/// 1) x * y = type(uint256).max * SCALE
/// 2) (x * y) % SCALE >= SCALE / 2
Expand Down
12 changes: 6 additions & 6 deletions contracts/PRBMathSD59x18.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ library PRBMathSD59x18 {
/// @dev Based on the insight that e^x = 2^(x * log2(e)).
///
/// Requirements:
/// - x must be less than 88722839111672999628.
/// - All from "log2".
/// - x must be less than 88722839111672999628.
///
/// @param x The exponent as a signed 59.18-decimal fixed-point number.
/// @return result The result as a signed 59.18-decimal fixed-point number.
Expand Down Expand Up @@ -476,14 +476,14 @@ library PRBMathSD59x18 {
/// fixed-point number.
///
/// @dev Variant of "mulDiv" that works with signed numbers and employs constant folding, i.e. the denominator is
/// alawys 1e18. See the documentation for the "PRBMathCommon.mulDivFixedPoint" function.
/// alawys 1e18.
///
/// Requirements:
/// - The result must fit within MAX_SD59x18.
/// - All from "PRBMathCommon.mulDivFixedPoint".
/// - The result must fit within MAX_SD59x18.
///
/// Caveats:
/// - All from "PRBMathCommon.mulDivFixedPoint".
/// - The body is purposely left uncommented; see the NatSpec comments in "PRBMathCommon.mulDiv" to understand how this works.
///
/// @param x The multiplicand as a signed 59.18-decimal fixed-point number.
/// @param y The multiplier as a signed 59.18-decimal fixed-point number.
Expand Down Expand Up @@ -522,11 +522,11 @@ library PRBMathSD59x18 {
/// @dev See https://en.wikipedia.org/wiki/Exponentiation_by_squaring
///
/// Requirements:
/// - All from "abs" and "mul".
/// - All from "abs" and "PRBMathCommon.mulDivFixedPoint".
/// - The result must fit within MAX_SD59x18.
///
/// Caveats:
/// - All from "mul".
/// - All from "PRBMathCommon.mulDivFixedPoint".
/// - Assumes 0^0 is 1.
///
/// @param x The base as a signed 59.18-decimal fixed-point number.
Expand Down
4 changes: 2 additions & 2 deletions contracts/PRBMathUD60x18.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ library PRBMathUD60x18 {
/// @dev Based on the insight that e^x = 2^(x * log2(e)).
///
/// Requirements:
/// - x must be less than 88722839111672999628.
/// - All from "log2".
/// - x must be less than 88722839111672999628.
///
/// @param x The exponent as an unsigned 60.18-decimal fixed-point number.
/// @return result The result as an unsigned 60.18-decimal fixed-point number.
Expand Down Expand Up @@ -395,7 +395,7 @@ library PRBMathUD60x18 {
/// - The result must fit within MAX_UD60x18.
///
/// Caveats:
/// - All from "mulDiv".
/// - All from "mul".
/// - Assumes 0^0 is 1.
///
/// @param x The base as an unsigned 60.18-decimal fixed-point number.
Expand Down

0 comments on commit 2c93624

Please sign in to comment.