Solved

Math

Posted on 1998-11-01
9
210 Views
Last Modified: 2010-04-15
How do I get the square root of a number?
0
Comment
Question by:p314159265
9 Comments
 
LVL 6

Accepted Solution

by:
thresher_shark earned 200 total points
ID: 1253987
Answer coming...
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1253988
To calculate the square root of a number, use the sqrt function like so:

#include <math.h>
.
double number = 4.0;
double result = sqrt (number);
ASSERT (result == 2.0);
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1253989
If you have any additional questions, please feel free to ask.  Thanks!
0
 

Author Comment

by:p314159265
ID: 1253990
What does 'ASSERT' do?
0
Will my email signature work in Office 365?

You've built an email signature using raw HTML code in Office 365, but you can't review how it looks with Transport Rules. So you have to test it over and over again before it can be used. Isn't this a bit of a waste of your time? Wouldn't a WYSIWYG editor make it a lot easier?

 
LVL 6

Expert Comment

by:thresher_shark
ID: 1253991
"ASSERT" performs a test that, if failed, will stop the program's execution.  In this case, it is basically saying, "If the square root of 4 is not 2, then stop the program from running."  Obviously, you would want that to happen because the square root of 4 is obviously 2.

If you have further questions, please ask.  Thanks!
0
 

Author Comment

by:p314159265
ID: 1253992
Thanks, that about covers it.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1253993
Of course, you don't NEED to use ASSERT...  Thresher just put it there as a code snippet to prove that the sqrt function works.

a=sqrt(b) is the only code you really need.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1253994
Yes, thank you scrapdog for clarifying :-)
0
 
LVL 1

Expert Comment

by:quanghoc
ID: 1253995
 I think you can use this function to get n root of a
Give a = x^n
=> x = exp((1/n)*log(a))
0

Featured Post

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now