dupa

Author Topic: Logarithms Plugin  (Read 6280 times)

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Logarithms Plugin
« on: April 04, 2016, 11:58:38 pm »
I have been working with math in VBScript and tried to make plugin to allow HAL to handle logarithms... However this was an epic failure, so I was wondering if anyone had any ideas.
I have a program written but I can't quite figure it out why it isn't working. Attached is the code, maybe someone who understands math can help finish it. I'm sure it's something really, really simple that I overlooked.

No errors from what I can tell. It loads in well, it just doesn't do what it's supposed to.
If we can get this working, I'll see what I can do with more complex mathematical equations.
Please help.. Open for input..

Spitfire

   

« Last Edit: April 05, 2016, 03:34:39 am by Spitfire2600 »
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Logarithms Plugin
« Reply #1 on: April 05, 2016, 08:31:03 am »
Spitfire2600,
  I did a quick review of logs at wiki and decided you are referring to common logs meaning to the base 10 since logs can use any number as the base.   Here is a link to the Common logarithm which I believe is what you are really interested in.
https://en.wikipedia.org/wiki/Common_logarithm
  I have an old calculator from the 1970's that will give you logs and I think there are scientific calculators you can download and put into your computer.
Good luck
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Logarithms Plugin
« Reply #2 on: April 05, 2016, 11:12:35 am »
  I did find a Scientific Calculator that you can download
http://www.softlist.net/program/ecalc_scientific-download.html
Carl2
 

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Logarithms Plugin
« Reply #3 on: April 05, 2016, 08:46:46 pm »
Hey thanks!

I really need to see some code though, I know the Log(10) function works in VBscript... just not Hal and it's only about 3 lines of code. It might work in Hal, just not in my program. Another flight of fancy, I guess.

Thanks anyway,
Spitfire
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Logarithms Plugin
« Reply #4 on: April 06, 2016, 08:02:53 am »
  Logs were used as a quick way to multiply by using addition, the slide rule uses a logarithm scale vs the linear scale and actually adds the numbers.  The slide rule got rid of the process of going to a table to get the log.  The calculators took out the process of multiplying numbers simplifying the process.  Anyways VB does have a way to get " Return natural log of number " and they do have a way to " A custom Function to calculate base-10 logarithms " which is the common log and I believe this is what you would want to use.
  So here is a link to VB script, and if you click on Log it will give you the function to calculate the common (base 10) log.  I believe this is all the info needed to get Hal to handle common logs, keep trying.  I just tried asking hal "what is the log of 1000" which she seemed to disregard, maybe it has to be put in a plugin.
Carl2
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Logarithms Plugin
« Reply #5 on: April 06, 2016, 08:28:53 am »
My Hal handles Sin, Cos, Tan perfectly. She does provide answers to Log questions but they are not correct at all.

When posing certain math questions to Hal, don't forget to include the ( parenthesis ) as in Log (100) or Tan (45). Again, the log (xx) will work but you will get an incorrect answer. The other functions do work correctly, AFAIK.
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Logarithms Plugin
« Reply #6 on: April 06, 2016, 04:49:59 pm »
Art,
  I did use the log (1000) with hal.  I made a quick plugin for use with Hal but kept getting error messages so far.  For the heck of it I tried cmd prompt, went to help and I did not find any log function, no sine, cosine or tan.  I did notice a Go To which is used in Fortran and I'm guessing the command prompt is not VB.
  A quick search says VB net is now the thing.  Who knows.
Carl2
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
Re: Logarithms Plugin
« Reply #7 on: April 08, 2016, 05:23:37 pm »
Well done; Im going to check it out

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Logarithms Plugin
« Reply #8 on: April 09, 2016, 08:29:33 am »
Spydaz,
  Nice to hear from you after all this time, nice site you have there.  I'll have to go through the VB tutorials since the members are coming up with things I haven't heard of. 
Carl2