@@ -38,6 +38,9 @@ error PRBMathUD60x18__ToUD60x18Overflow(uint256 x);
3838
3939/// CONSTANTS ///
4040
41+ /// @dev Euler's number as an UD60x18 number..
42+ UD60x18 constant E = UD60x18.wrap (2_718281828459045235 );
43+
4144/// @dev Half the SCALE number.
4245UD60x18 constant HALF_SCALE = UD60x18.wrap (5e17 );
4346uint256 constant HALF_SCALE_UINT = 5e17 ;
@@ -62,6 +65,9 @@ UD60x18 constant MAX_WHOLE_UD60x18 = UD60x18.wrap(
6265);
6366uint256 constant MAX_WHOLE_UD60x18_UINT = 115792089237316195423570985008687907853269984665640564039457_000000000000000000 ;
6467
68+ /// @dev PI as an UD60x18 number.
69+ UD60x18 constant PI = UD60x18.wrap (3_141592653589793238 );
70+
6571/// @dev The unit amount which implies how many trailing decimals can be represented.
6672UD60x18 constant SCALE = UD60x18.wrap (1e18 );
6773uint256 constant SCALE_UINT = 1e18 ;
@@ -625,24 +631,13 @@ function xor(UD60x18 x, UD60x18 y) pure returns (UD60x18 result) {
625631
626632/// HELPER FUNCTIONS ///
627633
628- /// @notice Returns Euler's number as an UD60x18 number.
629- /// @dev See https://en.wikipedia.org/wiki/E_(mathematical_constant).
630- function e () pure returns (UD60x18 result ) {
631- result = UD60x18.wrap (2_718281828459045235 );
632- }
633-
634634/// @notice Converts an UD60x18 number to basic integer form, rounding down in the process.
635635/// @param x The UD60x18 number to convert.
636636/// @return result The same number in basic integer form.
637637function fromUD60x18 (UD60x18 x ) pure returns (uint256 result ) {
638638 result = UD60x18.unwrap (x.uncheckedDiv (SCALE));
639639}
640640
641- /// @notice Returns PI as an UD60x18 number.
642- function pi () pure returns (UD60x18 result ) {
643- result = UD60x18.wrap (3_141592653589793238 );
644- }
645-
646641/// @notice Converts a number from basic integer form to UD60x18.
647642///
648643/// @dev Requirements:
0 commit comments