ScratchData LogoScratchData
Back to Kinderlabor's profile

Computer Error ?

KIKinderlabor•Created October 11, 2014
Computer Error ?
49
28
1654 views
View on Scratch

Instructions

What? 1.1 minus 1.0 is not 0.1 ? Don't worry, it is! But what the computer *stores* when you input 0.1 is *not* 0.1: Decimal numbers need to be converted to the internally used binary numbers. This conversion cannot always be exact, just like e.g. 1/3 cannot exactly be converted to a decimal number 0.333333... Was? 1.1 minus 1.0 ist nicht 0.1? Keine Sorge, es stimmt schon! Aber was der Computer *speichert", wenn du 0.1 eingibst, ist *nicht* 0.1: Dezimalzahlen müssen in die intern benutzten Binärzahlen umgewandelt werden. Diese Umwandlung kann nicht immer exakt sein, genau wie z.B. 1/3 nicht exakt in eine Dezimalzahl 0.333333... umgewandelt werden kann.

Description

The converter sprite defines a custom block for the exact conversion of a binary floating point number into a decimal number. That way, we can see that the binary floating point number that we get from input 0.1 (and many other inputs) is slightly off. Die Umwandler-Figur definiert einen Block zur exakten Umwandlung einer binären Fliesskommazahl in eine Dezimalzahl. So können wir sehen, dass die binäre Fliesskommazahl, die wir aus der Eingabe 0.1 (und vielen anderen Eingaben) erhalten, leicht falsch ist.

Project Details

Project ID29424952
CreatedOctober 11, 2014
Last ModifiedOctober 12, 2014
SharedOctober 11, 2014
Visibilityvisible
CommentsAllowed