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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like