GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 7 von 24 · Text

Coding floats

David Khieu

Coding Floats

Let's see how this convention is used to record numbers that are very small (in sense of their absolute value, which is close to zero). 

A physical constant called Planck's constant (and denoted as H) according to the textbooks, has the value of: 6.62607 x 10^-34.

If you would like to use it in a program, you should write it this way: 

6.62607E-34

Note: the fact that you've chosen one of the possible forms of coding float values doesn't mean that Python will present it the same way. 

Python may sometimes choose different notation than you. 

For example, let's say you've decided to use the following float literal: 

0.000000000000000000000001

When you run this literal through Python: 

Print(0.00000000000000001)

This is the result: 

1e-22

Python always chooses the more economical form of the number's presentation, and you should take this into consideration when creating literals. 

 

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck