Results 1 to 8 of 8

Thread: Square Roots!!!!!!!

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Angry

    How do I get square roots in vb?!!!! I've have been trying all day but can't find an equation! Please help. Thanks guys!

  2. #2
    Guest
    Sqr(number)

    where "number" is the number you want the square root of.

    This is how I do it using VB6

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    ARG!!!!!!!!! YOU'RE KIDDING!!!!!!!!!!!!!!! JUST SQR(number)??????????????????????? oh boy! I tried sqrt! Thank you sooooooooooooooooooo much!

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Or how about

    If you ever find there is no sqrt function in some language you are using, just remember your Math from school.

    Code:
      sqrt = x ^ (1/2)
    To use logarithms, use
    Code:
      sqrt = exp(log(x)/2)
    only this is less accurate than the first example.

    hehe

    This way you will know how to work out the nth root of any number in code...

    Regards
    Paul Lewis

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    hey steve, namezero has done something to ur web site

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Uh Oh! Damn namezero! Well my new homepage is this: http://www.geocities.com/stephenmack23/index.html
    thanks da_silvey!

    sqrt = x ^ (1/2)

    oh boy...a kid reccomended that but i heard wrong and tried squrt = x ^ -2


    Thanks so much guys! (we are in ch 4 in school, square roots was hidden in ch 8)

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    What book? (Oh yeah - age/grade?)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Im a freshman in high school, Im 14 The books name is.....drumroll.....An Introduction to Programming Using Microsoft Visual Basic Versions 5 & 6 . It sounds very basic but it goes from how to use windows to databases and stuff. Good book

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