Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Mathematical operations in C+=

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 07-13-2009, 11:03 AM PM User | #1 Active X New Coder   Join Date: Aug 2007 Posts: 74 Thanks: 3 Thanked 2 Times in 2 Posts Mathematical operations in C+= Hi to you dear professional programmer! I have a question about Math in C++. you calculate the second root or "square" root of a number in C++ with sqrt or another function, or with pow(number, 0.5). How can I calculate the third root ("Cubic" root) of a number ? Will be so thankful to your helps.
 07-13-2009, 11:45 AM PM User | #2 it career Banned   Join Date: Jun 2007 Location: Web Designer Posts: 321 Thanks: 0 Thanked 6 Times in 6 Posts pow(number,1.0/3)
 07-13-2009, 12:13 PM PM User | #3 BrickInTheWall Regular Coder     Join Date: Mar 2009 Location: Munich, Germany Posts: 139 Thanks: 1 Thanked 13 Times in 13 Posts third root of x is the same as x^(1/3) ...
 07-14-2009, 09:27 AM PM User | #4 Active X New Coder   Join Date: Aug 2007 Posts: 74 Thanks: 3 Thanked 2 Times in 2 Posts Yes, I know math so good. But have you tested it ever in your own compiler ?
07-14-2009, 01:05 PM   PM User | #5
abduraooft
Supreme Master coder!

Join Date: Mar 2007
Location: N/A
Posts: 14,775
Thanks: 159
Thanked 2,213 Times in 2,200 Posts
Try
Code:
```#include <stdio.h>
#include<math.h>
void main(){
double x=27;

printf("%lf ",pow(x,`(double)`1/3));
}```
__________________
Quote:
 The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

07-14-2009, 05:10 PM   PM User | #6
oracleguy
Rockstar Coder

Join Date: Jun 2002
Location: USA
Posts: 9,054
Thanks: 1
Thanked 322 Times in 318 Posts
Quote:
 Originally Posted by abduraooft Try Code: ```#include #include void main(){ double x=27; printf("%lf ",pow(x,`(double)`1/3)); }```
Or

Code:
`printf("%lf ",pow(x,1.0/3.0));`
__________________
OracleGuy

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 09:22 AM.