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.
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.