¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 7 de 24 · Texto

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. 

 

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?