Conversation
Notices
-
!CoderPonies Anyone know a simple algorithm for finding the number of digits in a number? Like 138273 = 6. xD
Wednesday, 19-Sep-12 22:17:58 UTC from web-
@minti Divide by ten until the number is less than ten, while keeping a count of number of divisions?
Wednesday, 19-Sep-12 22:21:55 UTC from web-
@cabinboybitshift Was trying to avoid using division. Hmm, time for a jsperf I think xD
Wednesday, 19-Sep-12 22:22:26 UTC from web-
@minti Of course, considering how optimised various conversions are, you might find len(n.toString()) ends up actually faster than anything you could hack together. :P
Wednesday, 19-Sep-12 22:23:45 UTC from web -
Wednesday, 19-Sep-12 22:36:36 UTC from web
-
@minti I'd appreciate if everyone opened this in their browsers and ran it, please.
Wednesday, 19-Sep-12 22:38:06 UTC from web-
@minti What does it prove
Wednesday, 19-Sep-12 22:38:51 UTC from web-
@renovatedkitchen Which method of getting the number of digits in a number is fastest. So far, regular old "count them by dividing by 10" seems fastest. O_o;
Wednesday, 19-Sep-12 22:39:32 UTC from web-
@minti Wait what? I'm lost here
Wednesday, 19-Sep-12 22:40:01 UTC from web-
@minti Im with bagles
Wednesday, 19-Sep-12 22:40:27 UTC from web -
@baglesman Click link, "run test", let it finish, close page. It'll just collect some information for me. :p
Wednesday, 19-Sep-12 22:40:45 UTC from web-
Wednesday, 19-Sep-12 22:43:12 UTC from web
-
@nlghtmaremoon I have no clue. I just got done watching a horror movie and I did this test thingy.
Wednesday, 19-Sep-12 22:44:01 UTC from web
-
-
-
-
-
-
@minti I'd probably get better results by closing this chrome profile and running it on a vanilla one, but oh well. http://ur1.ca/ac4zv
Wednesday, 19-Sep-12 22:40:40 UTC from web-
@nerthos Thanks!
Wednesday, 19-Sep-12 22:41:18 UTC from web-
Wednesday, 19-Sep-12 22:42:25 UTC from web
-
@minti What's this for?
Wednesday, 19-Sep-12 22:42:48 UTC from web-
@nerthos Me being OCD about how to do stuff the fastest way possible. xD
Wednesday, 19-Sep-12 22:43:45 UTC from web-
@minti Oh, sounds typical you xD
Wednesday, 19-Sep-12 22:44:00 UTC from web-
@nerthos Yeah, basically. xD
Wednesday, 19-Sep-12 22:44:14 UTC from web
-
-
-
-
-
-
-
-
-
-
@minti Of course, that would only work for integers, but still.
Wednesday, 19-Sep-12 22:22:27 UTC from web
-