Name of positive decimals that contain only digits (no signs - + or fractions)

106 Views Asked by At

From a programing point of view, I have build a function that validates only positive numbers that contain only digits, what I mean by positive numbers is: 1, 2, 3, ... not allowed $+x$, $-x$, $x.y$, $0x$.

Q: What is the best name to give this function to reflect it's purpose, that would be mathematical correct ?

After googling and going trough wikipedia I tougth at isDecimal(), but decimals allows fractional and negative numbers. I thought at isDigit() but this name makes me think that the function accepts only "one" digit. Maibe isPositiveFiniteDecimal() ?

Thank you

Disclaimer: I am not very familiar with mathematical terms, so please accept my apologies if I mixed them up

1

There are 1 best solutions below

4
On

After reading a few more Wikipedia pages I found out that the name for this is Natural number. Based on the Wikipedia definition the natural number is used for counting:

In mathematics, the natural numbers are those used for counting ("there are six coins on the table")

Even if I did not fully understand the article I think this is the correct word I was looking for, and to answer the question the function name should be "isNaturalNumber()".

Additional information or constructive criticism is welcome.

Thank you