Skip to content
Snippets Groups Projects
Commit 18b5224b authored by orestis.malaspin's avatar orestis.malaspin
Browse files

amelioration makefile

parent 846d1bd8
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -35,20 +35,29 @@ REVEALOPRIONS += --self-contained ...@@ -35,20 +35,29 @@ REVEALOPRIONS += --self-contained
SVG=$(wildcard figs/*.svg) SVG=$(wildcard figs/*.svg)
PNG=$(SVG:%.svg=%.png) PNG=$(SVG:%.svg=%.png)
MD=$(wildcard *.md)
HTML=$(MD:%.md=%.html)
all: $(PNG) intro.html variables.html types.html
all: $(PNG) $(HTML)
figs/%.png: figs/%.svg figs/%.png: figs/%.svg
convert \-flatten $< $@ convert \-flatten $< $@
intro.html: intro.md Makefile %.html: %.md Makefile
pandoc -s $(REVEALOPRIONS) -o $@ $< pandoc -s $(REVEALOPRIONS) -o $@ $<
variables.html: variables.md Makefile # intro.html: intro.md Makefile
pandoc -s $(REVEALOPRIONS) -o $@ $< # pandoc -s $(REVEALOPRIONS) -o $@ $<
types.html: types.md Makefile # variables.html: variables.md Makefile
pandoc -s $(REVEALOPRIONS) -o $@ $< # pandoc -s $(REVEALOPRIONS) -o $@ $<
# types.html: types.md Makefile
# pandoc -s $(REVEALOPRIONS) -o $@ $<
# control.html: control.md Makefile
# pandoc -s $(REVEALOPRIONS) -o $@ $<
clean: clean:
rm -rf intro.html variables.html types.html rm -rf *.html
...@@ -48,7 +48,7 @@ sansfont: Sans Serif ...@@ -48,7 +48,7 @@ sansfont: Sans Serif
## Les entiers (1/3) ## Les entiers (1/3)
- Il existe 4 tailles d'entiers (8, 16, 32, et 64 bits) qui viennent en signé ou non-signé. - Il existe 5 tailles d'entiers (8, 16, 32, 64, et 128 bits) qui viennent en *signé* ou *non-signé*.
- Également en taille dépendant de l'architecture - Également en taille dépendant de l'architecture
- `isize`{.rust} entier signé 32 ou 64 bits. - `isize`{.rust} entier signé 32 ou 64 bits.
- `usize`{.rust} entier non-signé 32 ou 64 bits. - `usize`{.rust} entier non-signé 32 ou 64 bits.
...@@ -64,6 +64,8 @@ sansfont: Sans Serif ...@@ -64,6 +64,8 @@ sansfont: Sans Serif
+---------------+---------------+--------------------+ +---------------+---------------+--------------------+
| 64 bits | `i64`{.rust} | `u64`{.rust} | | 64 bits | `i64`{.rust} | `u64`{.rust} |
+---------------+---------------+--------------------+ +---------------+---------------+--------------------+
| 128 bit | `i128`{.rust} | `u128`{.rust} |
+---------------+---------------+--------------------+
| 32 ou 64 bits | `isize`{.rust}| `usize`{.rust} | | 32 ou 64 bits | `isize`{.rust}| `usize`{.rust} |
+---------------+---------------+--------------------+ +---------------+---------------+--------------------+
...@@ -97,8 +99,6 @@ fn main() { ...@@ -97,8 +99,6 @@ fn main() {
## Les entiers (3/3) ## Les entiers (3/3)
- En mode *debug*, un dépassement d'entier produira une erreur à l'exécution. - En mode *debug*, un dépassement d'entier produira une erreur à l'exécution.
- **Attention**: En mode *release*, cela ne sera pas le cas.
<pre><code data-trim="hljs rust" class="lang-rust"> <pre><code data-trim="hljs rust" class="lang-rust">
fn main() { fn main() {
let x = 12341324; let x = 12341324;
...@@ -107,6 +107,15 @@ fn main() { ...@@ -107,6 +107,15 @@ fn main() {
println!("L'entier x vaut {}.", (x*y) as i32); // affichage println!("L'entier x vaut {}.", (x*y) as i32); // affichage
} }
</code></pre> </code></pre>
- **Attention**: En mode *release*, cela ne sera pas le cas.
<pre><code data-trim="hljs rust" class="lang-rust">
fn main() {
let x:i32 = 1234567891011; // en pratique cela produit un warning
println!("L'entier x vaut {}.", x); // affichage
}
</code></pre>
## Les nombres à virgule flottante ## Les nombres à virgule flottante
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment