That's not how cardinality is measured. The very first class on an introduction to set theory course will teach you that bijections are used to measure the size of a set.
Consider the tan function. When you give it a number between 0 and pi/2, it gives you a number between 0 and infinity, and it does so in a bijective way. Therefore there are equal numbers between 0 and pi/2 as compared to 0 to infinity. Now consider a simple linear function that multiplies its input by pi/2. From here we know that there are equal numbers between 0 and 1 as compared to 0 and pi/2.
Consider the tan function. When you give it a number between 0 and pi/2, it gives you a number between 0 and infinity, and it does so in a bijective way. Therefore there are equal numbers between 0 and pi/2 as compared to 0 to infinity. Now consider a simple linear function that multiplies its input by pi/2. From here we know that there are equal numbers between 0 and 1 as compared to 0 and pi/2.