The left argument of  ^.  Is the desired base.  So:

    log10 234
2.36922
   
   10^. 234
2.36922
   

Be happy.  Your function works!  Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Alex
Giannakopoulos
Sent: Tuesday, June 10, 2014 6:43 AM
To: J Programming forum
Subject: [Jprogramming] Log base 10

Which of these two is the more efficient (if there's any difference) and is
there any way way mere mortals can tell?

log10 =: 10 %&^.~ ]

logb10 =: 10&^inv

Further, if I only wanted to find the order of a given +ve integer

would it be better to do <. @ log10  (or <. @ logb10)
or something like:

<:@#@(10&#. inv)


Thanks
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to