Results 1 to 4 of 4

Thread: Algebra in VB

  1. #1

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Lightbulb Algebra in VB

    Hi does anyone know how to program Algebra in VB? For instance I want to calculate "x" times of "a". In other words, "a" cubed "x".

    I was thinking in VB should be something like this:
    VB Code:
    1. x=x+1
    2. While x=1
    3. yo=(a*a)*x
    4. Wend

    But it doesn't seem to work. Anyone? Even not a programmer, please give me ideas

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  2. #2
    Destined Soul
    Guest
    I'm not really sure what you want to do...

    If you want to find the answer of, say:

    y = a*(x*x*x) + b*(x*x) + c

    you can do this in VB by:
    VB Code:
    1. y = a*(x^3)+b*(x^2)+c
    The "^" symbol allows you to use powers. So by typing "2^3" you would get an answer of 8. "2^(-3)" gives 0.125 which is 1/8.

    If this isn't quite what you need, try to explain it a bit better - do you have any formulas you need to solve?

    Destined.

  3. #3
    wossname
    Guest
    y = a*(x*x*x) + b*(x*x) + c

    ...is actually faster than the equivalent...

    y = a*(x^3)+b*(x^2)+c

    If performance is important to you

  4. #4
    DerFarm
    Guest
    Function Power_Generator(a as double,x as long) as double
    dim lna as double

    lna = log(a)

    Power_Generator = exp(lna * x)

    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width