Output
$ rustc SampleMeanAndStdDev.rs
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:36:44
|
36 | println!("{}", format!("Sample mean: {0:.6f}", mean));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:37:49
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:10:5
|
10 | if args.len() != 2 {
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `exit` in this scope
--> SampleMeanAndStdDev.rs:12:3
|
12 | exit(1);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::process::exit;
|
error[E0425]: cannot find value `Utils` in this scope
--> SampleMeanAndStdDev.rs:14:29
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^^ not found in this scope
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:14:51
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `random` in this scope
--> SampleMeanAndStdDev.rs:21:17
|
21 | samples.push(random());
| ^^^^^^ not found in this scope
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:22:19
|
22 | sum += samples[i];
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:31:28
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0425]: cannot find function `pow` in this scope
--> SampleMeanAndStdDev.rs:31:16
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^^^ not found in this scope
error[E0425]: cannot find function `sqrt` in this scope
--> SampleMeanAndStdDev.rs:37:54
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^^^^ not found in this scope
|
help: use the `.` operator to call the method `sqrt` on `f64`
|
37 - println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
37 + println!("{}", format!("Sample std. dev.: {0:.6f}", variance.sqrt()));
|
error: aborting due to 11 previous errors
Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`.
$ rustc SampleMeanAndStdDev.rs
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:36:44
|
36 | println!("{}", format!("Sample mean: {0:.6f}", mean));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:37:49
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:10:5
|
10 | if args.len() != 2 {
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `exit` in this scope
--> SampleMeanAndStdDev.rs:12:3
|
12 | exit(1);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::process::exit;
|
error[E0425]: cannot find value `Utils` in this scope
--> SampleMeanAndStdDev.rs:14:29
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^^ not found in this scope
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:14:51
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `random` in this scope
--> SampleMeanAndStdDev.rs:21:17
|
21 | samples.push(random());
| ^^^^^^ not found in this scope
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:22:19
|
22 | sum += samples[i];
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:31:28
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0425]: cannot find function `pow` in this scope
--> SampleMeanAndStdDev.rs:31:16
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^^^ not found in this scope
error[E0425]: cannot find function `sqrt` in this scope
--> SampleMeanAndStdDev.rs:37:54
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^^^^ not found in this scope
|
help: use the `.` operator to call the method `sqrt` on `f64`
|
37 - println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
37 + println!("{}", format!("Sample std. dev.: {0:.6f}", variance.sqrt()));
|
error: aborting due to 11 previous errors
Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`.
$ rustc SampleMeanAndStdDev.rs
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:36:44
|
36 | println!("{}", format!("Sample mean: {0:.6f}", mean));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> SampleMeanAndStdDev.rs:37:49
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:10:5
|
10 | if args.len() != 2 {
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `exit` in this scope
--> SampleMeanAndStdDev.rs:12:3
|
12 | exit(1);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::process::exit;
|
error[E0425]: cannot find value `Utils` in this scope
--> SampleMeanAndStdDev.rs:14:29
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^^ not found in this scope
error[E0425]: cannot find value `args` in this scope
--> SampleMeanAndStdDev.rs:14:51
|
14 | let mut sampleSize:isize = Utils.stoiWithDefault(args[1], 10);
| ^^^^ not found in this scope
|
help: consider importing this function
|
7 + use std::env::args;
|
error[E0425]: cannot find function `random` in this scope
--> SampleMeanAndStdDev.rs:21:17
|
21 | samples.push(random());
| ^^^^^^ not found in this scope
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:22:19
|
22 | sum += samples[i];
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0277]: the type `[f64]` cannot be indexed by `isize`
--> SampleMeanAndStdDev.rs:31:28
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[f64]>` is not implemented for `isize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
= note: required for `Vec<f64>` to implement `Index<isize>`
error[E0425]: cannot find function `pow` in this scope
--> SampleMeanAndStdDev.rs:31:16
|
31 | variance += pow(samples[i] - mean,2.0f64);
| ^^^ not found in this scope
error[E0425]: cannot find function `sqrt` in this scope
--> SampleMeanAndStdDev.rs:37:54
|
37 | println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
| ^^^^ not found in this scope
|
help: use the `.` operator to call the method `sqrt` on `f64`
|
37 - println!("{}", format!("Sample std. dev.: {0:.6f}", sqrt(variance)));
37 + println!("{}", format!("Sample std. dev.: {0:.6f}", variance.sqrt()));
|
error: aborting due to 11 previous errors
Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`.