The Brihadaranyaka Upanishad, which was composed in the eighth or seventh century BC, and is traditionally attributed to the 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.
The composers of this hymn were comfortable with the concept of 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 use several terms to depict the concept of infinity.