where can we find a routine to calculate the square root of an integer with as many numbers after the coma as we want?
Printable View
where can we find a routine to calculate the square root of an integer with as many numbers after the coma as we want?
Have you tried the Sqr() Function?
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
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
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?
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?
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.
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.
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