Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
efinf:blc2016:lektion20160906 [2016/09/11 11:18] Ivo Blöchliger created |
efinf:blc2016:lektion20160906 [2016/09/11 11:20] (current) Ivo Blöchliger |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{backlinks> | ||
+ | ==== Donnerstag 6. September 2016 ==== | ||
* signed ints (Vorzeichenbehaftete Ganzzahlen). Anzahl Bytes ist festgelegt (typischerweise 8 auf 64-Bit Systemen). Höchstwertigstes Bit gibt Vorzeichen an (0 +, 1 -). | * signed ints (Vorzeichenbehaftete Ganzzahlen). Anzahl Bytes ist festgelegt (typischerweise 8 auf 64-Bit Systemen). Höchstwertigstes Bit gibt Vorzeichen an (0 +, 1 -). | ||
* Gegeben: Positive Zahl n (binär), gesucht Gegenzahl (binär): Bilde das Komplement von (n-1). | * Gegeben: Positive Zahl n (binär), gesucht Gegenzahl (binär): Bilde das Komplement von (n-1). | ||
Line 5: | Line 6: | ||
* Grösste Positive Zahl: 0x7f...ff. Kleinste negative Zahl: 0x10...00. Umfang $-2^{n-1}$ bis $2^{n-1}-1$ wenn man $n$ Bits zur Verfügung hat. | * Grösste Positive Zahl: 0x7f...ff. Kleinste negative Zahl: 0x10...00. Umfang $-2^{n-1}$ bis $2^{n-1}-1$ wenn man $n$ Bits zur Verfügung hat. | ||
* In vielen Programmiersprachen wird nicht auf Überlauf geprüft, d.h. wenn das Resultat einer Addition grösser ist, als die grösste positive Zahl, wird das Resultat einfach negativ (wie z.B. in C oder Java). In Ruby gibt es keine Überläufe, | * In vielen Programmiersprachen wird nicht auf Überlauf geprüft, d.h. wenn das Resultat einer Addition grösser ist, als die grösste positive Zahl, wird das Resultat einfach negativ (wie z.B. in C oder Java). In Ruby gibt es keine Überläufe, | ||
- | </ | + | |