mirror of
https://github.com/sigmasternchen/gleam-community-maths
synced 2025-03-15 07:59:01 +00:00
Fix doc examples
This commit is contained in:
parent
7ecaad5be2
commit
3704614309
1 changed files with 17 additions and 17 deletions
|
@ -96,13 +96,13 @@ import gleam_community/maths/elementary
|
||||||
///
|
///
|
||||||
/// pub fn example() {
|
/// pub fn example() {
|
||||||
/// piecewise.ceiling(12.0654, option.Some(1))
|
/// piecewise.ceiling(12.0654, option.Some(1))
|
||||||
/// |> should.equal(Ok(12.1))
|
/// |> should.equal(12.1)
|
||||||
///
|
///
|
||||||
/// piecewise.ceiling(12.0654, option.Some(2))
|
/// piecewise.ceiling(12.0654, option.Some(2))
|
||||||
/// |> should.equal(Ok(12.07))
|
/// |> should.equal(12.07)
|
||||||
///
|
///
|
||||||
/// piecewise.ceiling(12.0654, option.Some(3))
|
/// piecewise.ceiling(12.0654, option.Some(3))
|
||||||
/// |> should.equal(Ok(12.066))
|
/// |> should.equal(12.066)
|
||||||
/// }
|
/// }
|
||||||
/// </details>
|
/// </details>
|
||||||
///
|
///
|
||||||
|
@ -151,13 +151,13 @@ pub fn ceiling(x: Float, digits: option.Option(Int)) -> Float {
|
||||||
///
|
///
|
||||||
/// pub fn example() {
|
/// pub fn example() {
|
||||||
/// piecewise.floor(12.0654, option.Some(1))
|
/// piecewise.floor(12.0654, option.Some(1))
|
||||||
/// |> should.equal(Ok(12.0))
|
/// |> should.equal(12.0)
|
||||||
///
|
///
|
||||||
/// piecewise.floor(12.0654, option.Some(2))
|
/// piecewise.floor(12.0654, option.Some(2))
|
||||||
/// |> should.equal(Ok(12.06))
|
/// |> should.equal(12.06)
|
||||||
///
|
///
|
||||||
/// piecewise.floor(12.0654, option.Some(3))
|
/// piecewise.floor(12.0654, option.Some(3))
|
||||||
/// |> should.equal(Ok(12.065))
|
/// |> should.equal(12.065)
|
||||||
/// }
|
/// }
|
||||||
/// </details>
|
/// </details>
|
||||||
///
|
///
|
||||||
|
@ -206,13 +206,13 @@ pub fn floor(x: Float, digits: option.Option(Int)) -> Float {
|
||||||
///
|
///
|
||||||
/// pub fn example() {
|
/// pub fn example() {
|
||||||
/// piecewise.truncate(12.0654, option.Some(1))
|
/// piecewise.truncate(12.0654, option.Some(1))
|
||||||
/// |> should.equal(Ok(12.0))
|
/// |> should.equal(12.0)
|
||||||
///
|
///
|
||||||
/// piecewise.truncate(12.0654, option.Some(2))
|
/// piecewise.truncate(12.0654, option.Some(2))
|
||||||
/// |> should.equal(Ok(12.0))
|
/// |> should.equal(12.06)
|
||||||
///
|
///
|
||||||
/// piecewise.truncate(12.0654, option.Some(3))
|
/// piecewise.truncate(12.0654, option.Some(3))
|
||||||
/// |> should.equal(Ok(12.0))
|
/// |> should.equal(12.065)
|
||||||
/// }
|
/// }
|
||||||
/// </details>
|
/// </details>
|
||||||
///
|
///
|
||||||
|
@ -323,30 +323,30 @@ pub fn truncate(x: Float, digits: option.Option(Int)) -> Float {
|
||||||
/// pub fn example() {
|
/// pub fn example() {
|
||||||
/// // The default number of digits is 0 if None is provided
|
/// // The default number of digits is 0 if None is provided
|
||||||
/// piecewise.round(12.0654, option.None, option.Some(piecewise.RoundNearest))
|
/// 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
|
/// // The default rounding mode is "RoundNearest" if None is provided
|
||||||
/// piecewise.round(12.0654, option.None, option.None)
|
/// piecewise.round(12.0654, option.None, option.None)
|
||||||
/// |> should.equal(Ok(12.0))
|
/// |> should.equal(12.0)
|
||||||
///
|
///
|
||||||
/// // Try different rounding modes
|
/// // Try different rounding modes
|
||||||
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundNearest))
|
/// 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))
|
/// 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))
|
/// 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))
|
/// 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))
|
/// 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))
|
/// piecewise.round(12.0654, option.Some(2), option.Some(piecewise.RoundUp))
|
||||||
/// |> should.equal(Ok(12.07))
|
/// |> should.equal(12.07)
|
||||||
/// }
|
/// }
|
||||||
/// </details>
|
/// </details>
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue