DAY 008: LOG
#4
(11-13-2022, 03:24 PM)bplus Wrote: I don't use it much either but I did use it recently as is an alternate way to do powers.
This Log is the natural Log e AKA Ln, Not Log base 10.

I used this idea for String Math to do powers:
Code: (Select All)
' alternate to power 5 ^ 5

Print 5 ^ 5
Print Exp(5 * Log(5))

PS I think I recall Steve using it to get the number of digits in a number?
Update: that's in Wiki for a long pos integer.

It's an easy way to get the number of binary digits in a number.  Smile

Code: (Select All)
Print "Number of BINARY digits required to represent a value:"
For i = 1 To 20
    Print i, _Ceil(Log(i + .001) / Log(2)), _Bin$(i)
Next
Reply


Messages In This Thread
DAY 008: LOG - by SMcNeill - 11-13-2022, 11:17 AM
RE: DAY 008: LOG - by bplus - 11-13-2022, 03:24 PM
RE: DAY 008: LOG - by SMcNeill - 11-13-2022, 05:46 PM
RE: DAY 008: LOG - by mnrvovrfc - 11-13-2022, 05:17 PM
RE: DAY 008: LOG - by Pete - 11-13-2022, 05:55 PM
RE: DAY 008: LOG - by TerryRitchie - 11-13-2022, 07:40 PM
RE: DAY 008: LOG - by Pete - 11-13-2022, 08:12 PM
RE: DAY 008: LOG - by CharlieJV - 11-19-2022, 04:57 PM
RE: DAY 008: LOG - by bplus - 11-13-2022, 08:25 PM
RE: DAY 008: LOG - by Pete - 11-13-2022, 08:29 PM
RE: DAY 008: LOG - by luke - 11-19-2022, 06:36 AM



Users browsing this thread: 3 Guest(s)