Skip to content

Commit

Permalink
Fix doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
NicklasXYZ committed Aug 12, 2024
1 parent 7ecaad5 commit 3704614
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/gleam_community/maths/piecewise.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ import gleam_community/maths/elementary
///
/// pub fn example() {
/// piecewise.ceiling(12.0654, option.Some(1))
/// |> should.equal(Ok(12.1))
/// |> should.equal(12.1)
///
/// piecewise.ceiling(12.0654, option.Some(2))
/// |> should.equal(Ok(12.07))
/// |> should.equal(12.07)
///
/// piecewise.ceiling(12.0654, option.Some(3))
/// |> should.equal(Ok(12.066))
/// |> should.equal(12.066)
/// }
/// </details>
///
Expand Down Expand Up @@ -151,13 +151,13 @@ pub fn ceiling(x: Float, digits: option.Option(Int)) -> Float {
///
/// pub fn example() {
/// piecewise.floor(12.0654, option.Some(1))
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.0)
///
/// piecewise.floor(12.0654, option.Some(2))
/// |> should.equal(Ok(12.06))
/// |> should.equal(12.06)
///
/// piecewise.floor(12.0654, option.Some(3))
/// |> should.equal(Ok(12.065))
/// |> should.equal(12.065)
/// }
/// </details>
///
Expand Down Expand Up @@ -206,13 +206,13 @@ pub fn floor(x: Float, digits: option.Option(Int)) -> Float {
///
/// pub fn example() {
/// piecewise.truncate(12.0654, option.Some(1))
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.0)
///
/// piecewise.truncate(12.0654, option.Some(2))
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.06)
///
/// piecewise.truncate(12.0654, option.Some(3))
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.065)
/// }
/// </details>
///
Expand Down Expand Up @@ -323,30 +323,30 @@ pub fn truncate(x: Float, digits: option.Option(Int)) -> Float {
/// pub fn example() {
/// // The default number of digits is 0 if None is provided
/// piecewise.round(12.0654, option.None, option.Some(piecewise.RoundNearest))
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.0)
///
/// // The default rounding mode is "RoundNearest" if None is provided
/// piecewise.round(12.0654, option.None, option.None)
/// |> should.equal(Ok(12.0))
/// |> should.equal(12.0)
///
/// // Try different rounding modes
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundNearest))
/// |> should.equal(Ok(12.07))
/// |> should.equal(12.07)
///
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundTiesAway))
/// |> should.equal(Ok(12.07))
/// |> should.equal(12.07)
///
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundTiesUp))
/// |> should.equal(Ok(12.07))
/// |> should.equal(12.07)
///
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundToZero))
/// |> should.equal(Ok(12.06))
/// |> should.equal(12.06)
///
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundDown))
/// |> should.equal(Ok(12.06))
/// |> should.equal(12.06)
///
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundUp))
/// |> should.equal(Ok(12.07))
/// |> should.equal(12.07)
/// }
/// </details>
///
Expand Down

0 comments on commit 3704614

Please sign in to comment.