forked from extern/nushell
Update few examples of math commands (#7987)
# Description I just updated a few examples linked to math commands. I used the character of pi where possible, and I updated one example since the example was misleading IMO (for the tau command). # User-Facing Changes Only examples have been updated, there is no real user changes. # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
parent
b5561f35b9
commit
bea7ec33c1
@ -48,7 +48,7 @@ impl Command for SubCommand {
|
|||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![
|
vec![
|
||||||
Example {
|
Example {
|
||||||
description: "Apply the cosine to pi",
|
description: "Apply the cosine to π",
|
||||||
example: "math pi | math cos",
|
example: "math pi | math cos",
|
||||||
result: Some(Value::test_float(-1f64)),
|
result: Some(Value::test_float(-1f64)),
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,7 @@ impl Command for SubCommand {
|
|||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![
|
vec![
|
||||||
Example {
|
Example {
|
||||||
description: "Apply the tangent to pi/4",
|
description: "Apply the tangent to π/4",
|
||||||
example: "(math pi) / 4 | math tan",
|
example: "(math pi) / 4 | math tan",
|
||||||
result: Some(Value::test_float(1f64)),
|
result: Some(Value::test_float(1f64)),
|
||||||
},
|
},
|
||||||
|
@ -45,7 +45,7 @@ impl Command for SubCommand {
|
|||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![Example {
|
vec![Example {
|
||||||
description: "Apply the hyperbolic tangent to 10*pi",
|
description: "Apply the hyperbolic tangent to 10*π",
|
||||||
example: "(math pi) * 10 | math tanh",
|
example: "(math pi) * 10 | math tanh",
|
||||||
result: Some(Value::test_float(1f64)),
|
result: Some(Value::test_float(1f64)),
|
||||||
}]
|
}]
|
||||||
|
@ -29,9 +29,9 @@ impl Command for SubCommand {
|
|||||||
#[allow(clippy::approx_constant)]
|
#[allow(clippy::approx_constant)]
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![Example {
|
vec![Example {
|
||||||
example: "(math tau) / 2",
|
example: "math tau | math round --precision 2",
|
||||||
description: "Compare π and τ",
|
description: "Get the first two decimal digits of τ",
|
||||||
result: Some(Value::test_float(std::f64::consts::PI)),
|
result: Some(Value::test_float(6.28)),
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user