Hackerboard WikiHaboBlog

[HaBo]

 
Fun Section Witzige Geschichten aus der Computerwelt.

Das Wesen des Universums wurde 1972 entschlüsselt

Diskussion: Das Wesen des Universums wurde 1972 entschlüsselt im Forum Fun Section, in der Kategorie HaBo Lounge; Zitat: The myth that any given programming language is machine independent is easily exploded by computing the sum of powers ...

Antwort
Alt 17.07.10, 11:25   #1 (permalink)
 
Benutzerbild von bad_alloc
 
Registriert seit: 27.12.07
bad_alloc Leistung: Z3
Likes: 24
Standard Das Wesen des Universums wurde 1972 entschlüsselt


Zitat:
The myth that any given programming language is machine independent is easily exploded by computing the sum of powers of 2.
  • If the result loops with period = 1 with sign +, you are on a sign-magnitude machine.
  • If the result loops with period = 1 at -1, you are on a twos-complement machine.
  • If the result loops with period > 1, including the beginning, you are on a ones-complement machine.
  • If the result loops with period > 1, not including the beginning, your machine isn't binary -- the pattern should tell you the base.
  • If you run out of memory, you are on a string or Bignum system.
  • If arithmetic overflow is a fatal error, some fascist pig with a read-only mind is trying to enforce machine independence. But the very ability to trap overflow is machine dependent.
By this strategy, consider the universe, or, more precisely, algebra: let X = the sum of many powers of two = ...111111
now add X to itself; X + X = ...111110
thus, 2X = X - 1 so X = -1
therefore algebra is run on a machine (the universe) which is twos-complement.
Bonuspunkte für den der weiß woher das kommt, ohne Google zu benutzen!
Die Quelle   
http://home.pipeline.com/~hbaker1/hakmem/hacks.html#item154
__________________
You shoot yourself in somebody else's foot.|Dann gabs da noch den Mathematiker der P?=NP in O(1) erklärte.
|[A]| = p(·,|[A]|)+1
bad_alloc ist offline   Mit Zitat antworten
Antwort
   

Werbung ist gerade online    

[HaBo] » Sonstiges » HaBo Lounge » Fun Section » Das Wesen des Universums wurde 1972 entschlüsselt
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind aus
Pingbacks sind aus
Refbacks sind aus



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61