God by the knowledge of simple intelligence knows and comprehends infinite things.
I respond: For the understanding of the foregoing, it must be noted that according to the ancient doctors we are compelled to hold that God knows infinite things, as the Prophet David says in the Psalm: "Great is our Lord and great is his power, and of his wisdom there is no number"; and as Augustine not only asserts this but also proves it in the twelfth book of the City of God, the eighteenth chapter, where he speaks thus: "Therefore, as for that which certain ones, namely the philosophers, say—that not even ...by God's knowledge can infinite things be comprehended—it remains for them to dare to say, and to plunge themselves into this abyss of impiety, that God does not know all numbers. For it is most certain that they are infinite, since in whatever number you may think the end should be placed, that same number—I do not say can be increased by adding one—but however great it may be and however vast a multitude it may contain, it can by the very theory and science of numbers not only be doubled but even multiplied. Indeed, each number is so bounded by its own properties that none of them can be equal to any other: therefore they are both unequal among themselves and diverse, and each one individually is finite, and all together are infinite. Does God then not know all numbers on account of their infinity, and does the knowledge of God reach up to a certain sum of numbers and remain ignorant of the rest? Who, even the most demented, would say this?" And a little further on: "The infinity of number, therefore, although there is no number of infinite numbers, is nevertheless not incomprehensible to him whose understanding has no number. Wherefore, if whatever is comprehended by knowledge is made finite by the comprehension of the knower, then assuredly all infinity is in some ineffable manner made finite to God, because it is not incomprehensible to his knowledge. Therefore, if the infinity of numbers cannot be infinite to the knowledge of God by which it is comprehended, who are we, mere little men, to presume to fix a limit to his knowledge?"
By these testimonies, therefore, as by the most certain witnesses, we are compelled to say or to hold that God knows infinite things.
The manner of this position, however, is assigned by the more modern doctors, who have said that there is a threefold mode of divine cognition, not on account of a diversity of divine knowledge in itself, but in its connotation. For in God there is a knowledge of approbation, of vision, and of intelligence. The knowledge of approbation is of good things only, and of finite things. The knowledge of vision is of evil things and good things, but of finite things, inasmuch as it concerns time: for it is only of those things which were, are, and will be. But the knowledge of intelligence is of infinite things, inasmuch as God understands not only future things but also possible things: and the things possible to God are not finite but infinite.
The reason for this position, namely why we hold that God knows infinite things and does not make or will or dispose them, is that the divine knowing according to the third mode of understanding is an intrinsic act of God. By intrinsic I mean not only because it proceeds from what is intrinsic, but also because it is toward what is intrinsic and through what is intrinsic and according to an intrinsic mode. Toward what is intrinsic, I say, because the divine gaze in knowing does not leap outside itself, but by beholding itself as truth knows every truth. Through what is intrinsic, because through the eternal reasons, which are identical with himself, he knows whatever he knows. According to an intrinsic mode, because the divine knowing not only abstracts from the notion of actual cause, but also from that of cause absolutely. For he knows evils, of which he is not the cause; he also knows future things, which he does not yet bring about; he also knows possible things, which he will never bring about. And therefore, because knowing itself neither involves nor connotes anything actual outside, it signifies there an act in the mode of a habit, an act, I say, commensurate with the power itself — for whatever God can know, he knows — it also signifies an act in no way restricted, neither with respect to itself nor with respect to what is connoted, therefore universal with respect to places, with respect to times, and with respect to objects. For whatever he knew somewhere he knows everywhere, and whatever he knows once he knows always, and just as he knows one thing, so he knows all knowable things. Whence, because knowable things are not only beings in act, but also in potency: since it is not unfitting to hold that there are infinite things in potency, it is not unfitting to hold that infinite things are actually known by God.
Source: Quaestiones Disputatae, De Scientia Christi, Question 1