Why this number doesn't stored in floats 7 when 2/4 and 7.0 can?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why this number doesn't stored in floats 7 when 2/4 and 7.0 can??

there no bigger change between 7 n 7.0 are meant same

9th Feb 2017, 2:55 PM
hackey
hackey - avatar
5 Answers
+ 4
Because the result of division with only one "/" is always a float and you define "7.0" as a float when you write the point zero at the end. "7" is just seven written as an integer, "7.0" is seven written as a float. PS, the division will return an integer instead of a float when you use "//" Ex: 4//2=2 Ex: 4/2=2.0
10th Feb 2017, 4:24 PM
Asa Juleff
Asa Juleff - avatar
+ 1
oh ...K then an decimal numbers are only included in float
12th Feb 2017, 3:49 PM
hackey
hackey - avatar
+ 1
because it is an like decimal point
14th Feb 2017, 5:00 PM
Elangowan
Elangowan - avatar
0
yes sir
12th Feb 2017, 6:34 PM
Asa Juleff
Asa Juleff - avatar
0
no but a tin can
16th Mar 2017, 1:25 PM
maisie