The Brihadaranyaka Upanishad, which is believed by scholars to have been composed in the eighth or seventh centuries B.C., and is traditionally attributed to the Hindu Vedic philosopher Yajnavalkya, has a discussion of the concept of infinity. Here’s a hymn in which infinity is being discussed:
पूर्णमदः पूर्णमिदं पूर्णात् पूर्णमुदच्यते ।
पूर्णस्य पूर्णमादाय पूर्णमेवावशिष्यते ॥
(purnam adah, purnam idam purnat purnam udachyate; purnasya purnam adaya purnam evavasisyate.)
Translation: “Fullness is there, fullness is here, fullness from fullness proceeds; when fullness is taken from fullness, fullness remains.” When infinity is taken out of infinity, infinity is what remains.
Those who composed this hymn were comfortable with the concept of very large numbers which verge on infinity. There can be a religious interpretation of this hymn: god is infinite, a part of god has gone into the creation of the material world, but because of that god has not become less, he is still infinite. The Vedas and other ancient Hindu texts use several terms to depict the concept of infinity.