Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jeremy.meissner
cours
Commits
1dc785ad
Verified
Commit
1dc785ad
authored
3 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
ajout maxint unsigned
parent
c855399f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/cours_4.md
+40
-3
40 additions, 3 deletions
slides/cours_4.md
with
40 additions
and
3 deletions
slides/cours_4.md
+
40
−
3
View file @
1dc785ad
...
...
@@ -343,11 +343,46 @@ Que donne l'addition `1101` avec `0110`?
. . .
## Dépassement de capacité: le nombre est tronqué
## Dépassement de capacité: le nombre est
"
tronqué
"
*
`10011 (19) -> 0011 (3)`
.
*
On fait "le tour"."
# Entier non-signés minimal/maximal
*
Quel est l'entier non-signé maximal représentable avec 4 bit?
. . .
$$
(1111)_2 = 8+4+2+1 = 15
$$
*
Quel est l'entier non-signé minimal représentable avec 4 bit?
. . .
$$
(0000)_2 = 0+0+0+0 = 0
$$
*
Quel est l'entier non-signé min/max représentable avec N bit?
. . .
$$
0
\m
box{ et }2^N-1.
$$
*
Donc
`uint32_t?`
maximal est?
. . .
$$
4294967295
$$
# Les multiplications en binaire (1/2)
Que donne la multiplication de
`1101`
avec
`0110`
?
...
...
@@ -394,8 +429,9 @@ Que donne la multiplication de `1101` avec `0110`?
# Entiers signés (1/N)
*
La représentation qu'on vient de voir
<!-- # TODO --
>
<!-- # TODO --
<!-- ## Entiers, entiers non-signés -->
...
...
@@ -407,7 +443,6 @@ Que donne la multiplication de `1101` avec `0110`?
## Fractions
*
Plusieurs variables qu'on aimerait regrouper dans un seul type:
`struct`
{.C}.
*
Numérateur:
`int num`
;
*
Dénominateur:
`int denom`
.
...
...
@@ -426,6 +461,8 @@ int denom3 = denom1 * denom2;
## On peut faire mieux
*
Plusieurs variables qu'on aimerait regrouper dans un seul type:
`struct`
{.C}.
```
C
struct fraction { // déclaration du type
int32_t num, denom;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment