rugheid / Swift-MathEagle

A general math framework to make using math easy. Currently supports function solving and optimisation, matrix and vector algebra, complex numbers, big int, big frac, big rational, graphs and general handy extensions and functions.
MIT License
42 stars 6 forks source link

Make numberOfDigits function #7

Closed rugheid closed 8 years ago

rugheid commented 8 years ago

This function could use something like this, but then Swifty:

n = 1;
if (i >= 100000000){i /= 100000000; n += 8;}
if (i >= 10000){i /= 10000; n += 4;}
if (i >= 100){i /= 100; n += 2;}
if (i >= 10){i /= 10; n += 1;}