@@ -92,7 +92,7 @@ cast! {
9292/// Raises a value to some exponent.
9393///
9494/// ```example
95- /// #calc.pow(2, 3)
95+ /// #calc.pow(2, 3) \
9696/// #calc.pow(decimal("2.5"), 2)
9797/// ```
9898#[ func( title = "Power" ) ]
@@ -236,7 +236,6 @@ pub fn root(
236236/// radians.
237237///
238238/// ```example
239- /// #assert(calc.sin(90deg) == calc.sin(-270deg))
240239/// #calc.sin(1.5) \
241240/// #calc.sin(90deg)
242241/// ```
@@ -258,7 +257,6 @@ pub fn sin(
258257/// radians.
259258///
260259/// ```example
261- /// #calc.cos(90deg) \
262260/// #calc.cos(1.5) \
263261/// #calc.cos(90deg)
264262/// ```
@@ -621,10 +619,10 @@ pub fn lcm(
621619/// 64-bit signed integer or smaller than the minimum for that type.
622620///
623621/// ```example
622+ /// #calc.floor(500.1)
624623/// #assert(calc.floor(3) == 3)
625624/// #assert(calc.floor(3.14) == 3)
626625/// #assert(calc.floor(decimal("-3.14")) == -4)
627- /// #calc.floor(500.1)
628626/// ```
629627#[ func]
630628pub fn floor (
@@ -648,10 +646,10 @@ pub fn floor(
648646/// 64-bit signed integer or smaller than the minimum for that type.
649647///
650648/// ```example
649+ /// #calc.ceil(500.1)
651650/// #assert(calc.ceil(3) == 3)
652651/// #assert(calc.ceil(3.14) == 4)
653652/// #assert(calc.ceil(decimal("-3.14")) == -3)
654- /// #calc.ceil(500.1)
655653/// ```
656654#[ func]
657655pub fn ceil (
@@ -675,10 +673,10 @@ pub fn ceil(
675673/// 64-bit signed integer or smaller than the minimum for that type.
676674///
677675/// ```example
676+ /// #calc.trunc(15.9)
678677/// #assert(calc.trunc(3) == 3)
679678/// #assert(calc.trunc(-3.7) == -3)
680679/// #assert(calc.trunc(decimal("8493.12949582390")) == 8493)
681- /// #calc.trunc(15.9)
682680/// ```
683681#[ func( title = "Truncate" ) ]
684682pub fn trunc (
@@ -698,9 +696,9 @@ pub fn trunc(
698696/// If the number is an integer, returns `0`.
699697///
700698/// ```example
699+ /// #calc.fract(-3.1)
701700/// #assert(calc.fract(3) == 0)
702701/// #assert(calc.fract(decimal("234.23949211")) == decimal("0.23949211"))
703- /// #calc.fract(-3.1)
704702/// ```
705703#[ func( title = "Fractional" ) ]
706704pub fn fract (
@@ -734,6 +732,7 @@ pub fn fract(
734732/// for maximum and minimum respectively.
735733///
736734/// ```example
735+ /// #calc.round(3.1415, digits: 2)
737736/// #assert(calc.round(3) == 3)
738737/// #assert(calc.round(3.14) == 3)
739738/// #assert(calc.round(3.5) == 4.0)
@@ -745,7 +744,6 @@ pub fn fract(
745744/// #assert(calc.round(decimal("7.123456789"), digits: 6) == decimal("7.123457"))
746745/// #assert(calc.round(decimal("3333.45"), digits: -2) == decimal("3300"))
747746/// #assert(calc.round(decimal("-48953.45"), digits: -3) == decimal("-49000"))
748- /// #calc.round(3.1415, digits: 2)
749747/// ```
750748#[ func]
751749pub fn round (
@@ -776,11 +774,11 @@ pub fn round(
776774/// Clamps a number between a minimum and maximum value.
777775///
778776/// ```example
777+ /// #calc.clamp(5, 0, 4)
779778/// #assert(calc.clamp(5, 0, 10) == 5)
780779/// #assert(calc.clamp(5, 6, 10) == 6)
781780/// #assert(calc.clamp(decimal("5.45"), 2, decimal("45.9")) == decimal("5.45"))
782781/// #assert(calc.clamp(decimal("5.45"), decimal("6.75"), 12) == decimal("6.75"))
783- /// #calc.clamp(5, 0, 4)
784782/// ```
785783#[ func]
786784pub fn clamp (
@@ -991,7 +989,7 @@ pub fn div_euclid(
991989/// #calc.rem-euclid(7, -3) \
992990/// #calc.rem-euclid(-7, 3) \
993991/// #calc.rem-euclid(-7, -3) \
994- /// #calc.rem-euclid(1.75, 0.5)
992+ /// #calc.rem-euclid(1.75, 0.5) \
995993/// #calc.rem-euclid(decimal("1.75"), decimal("0.5"))
996994/// ```
997995#[ func( title = "Euclidean Remainder" ) ]
0 commit comments