Pure Programmer
Blue Matrix


Cluster Map

Project: Cubic Roots (Command Line)

Cubic equations of the form Ax3 + Bx2 + Cx + D = 0 have three possible solutions given by the [[Cubic Formula]]. Write a program that accepts the four constants on the command line then prints the three possible solutions.

See: CubicRoots

Output
$ rustc CubicRootsCmdLine.rs error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:11:14 | 11 | let A:f64 = Utils.stodWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:11:36 | 11 | let A:f64 = Utils.stodWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:12:14 | 12 | let B:f64 = Utils.stodWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:12:36 | 12 | let B:f64 = Utils.stodWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:13:14 | 13 | let C:f64 = Utils.stodWithDefault(args[3], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:13:36 | 13 | let C:f64 = Utils.stodWithDefault(args[3], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:14:14 | 14 | let D:f64 = Utils.stodWithDefault(args[4], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:14:36 | 14 | let D:f64 = Utils.stodWithDefault(args[4], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `PI` in this scope --> CubicRootsCmdLine.rs:36:39 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^ not found in this scope | help: consider importing one of these items | 8 + use consts::PI; | 8 + use std::f32::consts::PI; | error[E0425]: cannot find value `PI` in this scope --> CubicRootsCmdLine.rs:37:39 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^ not found in this scope | help: consider importing one of these items | 8 + use consts::PI; | 8 + use std::f32::consts::PI; | warning: unused import: `std::f64::consts` --> CubicRootsCmdLine.rs:8:5 | 8 | use std::f64::consts; | ^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:23:21 | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.f64 * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 23 | let mut p:f64 = (3.0f64 * A * C - B * B) / (3.f64 * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:23:47 | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.f64 * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.0f64 * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:21 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.0f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:41 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.0f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:62 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.0f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:85 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.0f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:32:20 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 32 | let mut a:f64 = 2.0f64 * sqrt(-p / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:32:38 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.0f64); | + error[E0425]: cannot find function `sqrt` in this scope --> CubicRootsCmdLine.rs:32:26 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:21 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.0f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:29 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.0f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:43 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.0f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:55 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.0f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:73 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.0f64 / p)); | + error[E0425]: cannot find function `sqrt` in this scope --> CubicRootsCmdLine.rs:33:65 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^^ not found in this scope error[E0425]: cannot find function `acos` in this scope --> CubicRootsCmdLine.rs:33:36 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^^ not found in this scope error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:35:23 | 35 | let mut t1:f64 = a * cos(b); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:36:33 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 36 | let mut t2:f64 = a * cos(b - 2.0f64 * PI / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:36:46 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.0f64); | + error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:36:23 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:37:33 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 37 | let mut t3:f64 = a * cos(b - 4.0f64 * PI / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:37:46 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.0f64); | + error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:37:23 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:38:34 | 38 | let mut root1:f64 = t1 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 38 | let mut root1:f64 = t1 - B / (3.0f64 * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:39:34 | 39 | let mut root2:f64 = t2 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 39 | let mut root2:f64 = t2 - B / (3.0f64 * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:40:34 | 40 | let mut root3:f64 = t3 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 40 | let mut root3:f64 = t3 - B / (3.0f64 * A); | + error: aborting due to 36 previous errors; 1 warning emitted Some errors have detailed explanations: E0425, E0610. For more information about an error, try `rustc --explain E0425`. $ rustc CubicRootsCmdLine.rs error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:11:14 | 11 | let A:f64 = Utils.stodWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:11:36 | 11 | let A:f64 = Utils.stodWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:12:14 | 12 | let B:f64 = Utils.stodWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:12:36 | 12 | let B:f64 = Utils.stodWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:13:14 | 13 | let C:f64 = Utils.stodWithDefault(args[3], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:13:36 | 13 | let C:f64 = Utils.stodWithDefault(args[3], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> CubicRootsCmdLine.rs:14:14 | 14 | let D:f64 = Utils.stodWithDefault(args[4], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> CubicRootsCmdLine.rs:14:36 | 14 | let D:f64 = Utils.stodWithDefault(args[4], 0); | ^^^^ not found in this scope | help: consider importing this function | 8 + use std::env::args; | error[E0425]: cannot find value `PI` in this scope --> CubicRootsCmdLine.rs:36:39 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^ not found in this scope | help: consider importing one of these items | 8 + use consts::PI; | 8 + use std::f32::consts::PI; | error[E0425]: cannot find value `PI` in this scope --> CubicRootsCmdLine.rs:37:39 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^ not found in this scope | help: consider importing one of these items | 8 + use consts::PI; | 8 + use std::f32::consts::PI; | warning: unused import: `std::f64::consts` --> CubicRootsCmdLine.rs:8:5 | 8 | use std::f64::consts; | ^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:23:21 | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.f64 * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 23 | let mut p:f64 = (3.0f64 * A * C - B * B) / (3.f64 * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:23:47 | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.f64 * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 23 | let mut p:f64 = (3.f64 * A * C - B * B) / (3.0f64 * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:21 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.0f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:41 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.0f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:62 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.0f64 * A * A * D) / (27.f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:24:85 | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.f64 * A * A * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 24 | let mut q:f64 = (2.f64 * B * B * B - 9.f64 * A * B * C + 27.f64 * A * A * D) / (27.0f64 * A * A * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:32:20 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 32 | let mut a:f64 = 2.0f64 * sqrt(-p / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:32:38 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.0f64); | + error[E0425]: cannot find function `sqrt` in this scope --> CubicRootsCmdLine.rs:32:26 | 32 | let mut a:f64 = 2.f64 * sqrt(-p / 3.f64); | ^^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:21 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.0f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:29 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.0f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:43 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.0f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:55 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.0f64 / p * sqrt(-3.f64 / p)); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:33:73 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.0f64 / p)); | + error[E0425]: cannot find function `sqrt` in this scope --> CubicRootsCmdLine.rs:33:65 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^^ not found in this scope error[E0425]: cannot find function `acos` in this scope --> CubicRootsCmdLine.rs:33:36 | 33 | let mut b:f64 = (1.f64 / 3.f64) * acos(3.f64 * q / 2.f64 / p * sqrt(-3.f64 / p)); | ^^^^ not found in this scope error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:35:23 | 35 | let mut t1:f64 = a * cos(b); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:36:33 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 36 | let mut t2:f64 = a * cos(b - 2.0f64 * PI / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:36:46 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.0f64); | + error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:36:23 | 36 | let mut t2:f64 = a * cos(b - 2.f64 * PI / 3.f64); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:37:33 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 37 | let mut t3:f64 = a * cos(b - 4.0f64 * PI / 3.f64); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:37:46 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.0f64); | + error[E0425]: cannot find function `cos` in this scope --> CubicRootsCmdLine.rs:37:23 | 37 | let mut t3:f64 = a * cos(b - 4.f64 * PI / 3.f64); | ^^^ not found in this scope error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:38:34 | 38 | let mut root1:f64 = t1 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 38 | let mut root1:f64 = t1 - B / (3.0f64 * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:39:34 | 39 | let mut root2:f64 = t2 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 39 | let mut root2:f64 = t2 - B / (3.0f64 * A); | + error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> CubicRootsCmdLine.rs:40:34 | 40 | let mut root3:f64 = t3 - B / (3.f64 * A); | ^^^ | help: if intended to be a floating point literal, consider adding a `0` after the period | 40 | let mut root3:f64 = t3 - B / (3.0f64 * A); | + error: aborting due to 36 previous errors; 1 warning emitted Some errors have detailed explanations: E0425, E0610. For more information about an error, try `rustc --explain E0425`.

Solution