Is 5.0 an Integer or Decimal Number?

Is 5.0 an Integer or Decimal Number?
$\begingroup$

Is 5.0 an integer or decimal number? I was asked by one of my friends, we got both confused.

I said by definition integer contains no or zero decimal part so it should be an integer. But he said that 5.0 contains decimal point so it should be a decimal number.

Now I am wondering who is correct, I surfed on internet but didn't find like which one is correct? Please help me in this.

$\endgroup$
0

1 Answer

$\begingroup$

Why not both?

Calling a number integer refers to its value. Calling a number a decimal refers to the way it was written down.

5.0 is an integer number written in the decimal notation.

$\endgroup$
18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.