I was wondering if you guys know a way to find the first digit of a number.I know that modulus gets you the last digit of a number, for instance 456%10 = 6 in remainder but how do you find the first digit?

Follow Math Help Forum on Facebook and Google+

Originally Posted by NidhiS I was wondering if you guys know a way to find the first digit of a number.I know that modulus gets you the last digit of a number, for instance 456%10 = 6 in remainder but how do you find the first digit? This is a childish answer not always useful ( in fact rarely) If the number of digits= n Then Where "[ ]" stands for greatest integer function

Originally Posted by NidhiS I was wondering if you guys know a way to find the first digit of a number.I know that modulus gets you the last digit of a number, for instance 456%10 = 6 in remainder but how do you find the first digit? Why not just divide the first digit(s) by 10?

View Tag Cloud