Results 1 to 9 of 9

Thread: square root of an integer routine

  1. #1
    Guest

    Post

    where can we find a routine to calculate the square root of an integer with as many numbers after the coma as we want?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Have you tried the Sqr() Function?

  3. #3
    Member
    Join Date
    Jan 2000
    Location
    Southbridge, MA, USA
    Posts
    40

    Post

    I have a feeling I might have missed something in the question, but if iNumber is some integer then, Sqr(iNumber) will return the square root of iNumber as a double. But VB only displays 15 characters, Sqr of anything <100 will display 14 decimal places, <10000, 13, etc.
    If you want to display fewer digits, then do a Format$(Sqr(iNumber),"0.0000") to as many, or few places.
    If I missed what your question was asking, I apologize.
    --Carl

  4. #4
    Guest

    Post

    the sqr function returns a double; I'll never have more than 15 digits in the mantissa;
    what if I want a 500 digits mantissa

  5. #5
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    Ok, maybe I was asleep that day in math class, but I've been taking math for 13 years now and I am currently in 2nd year college calculus and I have never heard of a Mantissa. What is it?
    -Ryan
    I smell varmint poontang, and the only good varmint poontang is dead varmint poontang...

    -Bill Murray, Caddyshack

  6. #6
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301

    Post

    Mantissa is a green little insect (about a quarter inch) that eats small pebbles.

    OR do you refer to the number of decimals of a number?



  7. #7
    Hyperactive Member
    Join Date
    Jun 1999
    Posts
    308

    Post

    Rayn!

    It is very sad you have slept over.

    INTEGRATED MATHEMATICS (text book for hight school}:

    "The positive decimal part of common logarithm is called MANTISSA....."

    Same for sguare root, I just dont have any textbooks earler grades.


  8. #8
    Hyperactive Member
    Join Date
    Jun 1999
    Posts
    308

    Post

    Double returns you more then 15 numbers, but only these15 are pricese (that exactly what means Double)
    Single nambers are 7 digits ( single precision).

    So in Vb 15 - is all you got. But it still can be calculated in certain way, but will take a hard work.

  9. #9
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    ooer!

    Perhaps you need to code The Newton-Raphson method of calculating square roots using VB

    Edited by Mark Sreeves on 02-25-2000 at 07:20 AM
    Mark
    -------------------

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