| title | Presentation |
|---|---|
| author | myself |
| date | 1/1/2018 |
| lang | en |
| keywords | rust,fmi |
| description | lecture about stuff |
| slide-width | 50% |
| font-size | 20px |
| font-family | Arial, Helvetica, sans-serif |
| code-theme | github |
This is how to implement the following formulae in Rust
fn solve(a: f64, b: f64, c: f64) -> (f64, f64) {
let d = f64::sqrt(b*b - 4.*a*c);
((-b+d)/(2.*a), (-b-d)/(2.*a))
}
fn main() {
let (x1, x2) = solve(1., 2., 1.);
println!("x1 = {}, x2 = {}", x1, x2);
}# // norun
struct A<T> {
a: T,
b: Vec<Box<Iterator<Item=u8>>>
}
# fn main() {}# // norun
# fn main() {
let a = "string";
let b: String = a;
# }- item 1 --
- item 2
--
- item 3 --
%%
# // ignore
struct A {
pub counter: i32;
}class A {
public:
int counter;
}%%
# // norun
fn solve(a: f64, b: f64, c: f64) -> (f64, f64) {
let d = f64::sqrt(b*b - 4.*a*c);
((-b+d)/(2.*a), (-b-d)/(2.*a));
}
fn main() {
let (x1, x2) = solve(1., 2., 1.);
println!("x1 = {}, x2 = {}", x1, x2);
}| Header1 | Header2 |
|---|---|
| u8 | char |
| u32 | unsigned |
%%
| Header1 | Header2 |
|---|---|
| 1 | 2 |
<table>
<thead>
<tr>
<th>Header1</th>
<th>Header2</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
</tbody>
</table>%%
@@table h1 h2 @ c1 c2 @@ "h1": "Header1", "h2": "Header2", "c1": "1", "c2": "2" @@end
@@table
h1 h2
@
c1 c2
@@
"h1": "Header1",
"h2": "Header2",
"c1": "1",
"c2": "2"
@@end-np%%
@@table header1 header1 header2 @ content1 content1 content2 content1 content1 content3 @@ "header1": { "text": "...", "style": "color: red" }, "header2": "...", "content1": "...", "content2": "...", "content3": "..." @@end
@@table header header header @ content1 content1 content2 content5 content9 content4 content5 content6 content6 @@ @@end
@@table header1 header2 header2 @ content1 content1 content1 content3 content9 content2 content4 content1 content1 @@ "content1": "..." @@end
