Browse Source

docs(lalgebra_scaler) correct grammar

1127-print-range-subject
davhojt 2 years ago committed by Dav Hojt
parent
commit
342528c2cd
  1. 16
      subjects/lalgebra_scalar/README.md

16
subjects/lalgebra_scalar/README.md

@ -2,19 +2,15 @@
### Instructions
Define a `Scalar` trait which must implement the operations Addition, Subtraction, Multiplication and Division (you might also have to use more restrictions). For this use a trait inheritance (supertraits)
Define a `Scalar` trait which implements the operations `Add`, `Sub`, `Mul`, `Div` and any other restrictions you may need. Use a trait inheritance (supertraits)
Another condition for a number to be a scalar is to have a zero (neutral element in the addition) and a one (neutral element in the multiplication). Therefore the `Scalar` trait will require 2 functions zero() and one() (as shown)
Another condition for a number to be a scalar is to have a `zero` (as the neutral element in the addition), and a `one` (as the neutral element in the multiplication). Therefore the `Scalar` trait will require these two functions (described below).
After finishing completing the declaration of the trait, implement the `Scalar` trait for u32, u64, i32, i64, f32 and f64.
### Notions
- [Module std::ops](https://doc.rust-lang.org/std/ops/index.html)
After finishing completing the declaration of the trait, implement the `Scalar` trait for `u32`, `u64`, `i32`, `i64`, `f32` and `f64`.
### Expected Function (The signature must be completed)
#### You need add the impl for each cases asked in the subject
> You need add the impl for each cases asked in the subject
```rust
pub trait Scalar: _ {
@ -49,3 +45,7 @@ $ cargo run
1
$
```
### Notions
- [Module std::ops](https://doc.rust-lang.org/std/ops/index.html)

Loading…
Cancel
Save