473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Cube root

I routinely use sqrt(x) for getting a cube root in vb.net. does anyone
know of a way of getting the cube root? I tried cbrt(x) and that
didn't work.
thanks!
Sep 23 '08 #1
5 20248
the cube root of positive x is
x ^ (1 / 3)

"Brock" wrote:
I routinely use sqrt(x) for getting a cube root in vb.net. does anyone
know of a way of getting the cube root? I tried cbrt(x) and that
didn't work.
thanks!
Sep 23 '08 #2
jch
Maybe there's built-in VB function to do this but here's how I'd do it.

dblCubeRoot = dblNumber ^ (1/3)

You can change '3' to be whatever root you're trying to get. Ex: (1/2)
would give you the square root.
Brock wrote:
I routinely use sqrt(x) for getting a cube root in vb.net. does anyone
know of a way of getting the cube root? I tried cbrt(x) and that
didn't work.
thanks!

Sep 23 '08 #3
AMercer wrote:
the cube root of positive x is
x ^ (1 / 3)
Ahem! :-) The /real/ cube root of x is x^(1/3).

Console.WriteLine( -8 ^ (1 / 3)) correctly gives -2. The complex roots are,
of course, beyond my brain this early in the morning.

Andrew
Sep 24 '08 #4
Console.WriteLine( -8 ^ (1 / 3)) correctly gives -2.

The minus sign applies to the entire expression; it needs to apply to 8.
(-8) ^ (1 / 3) is NAN.
Sep 24 '08 #5
AMercer wrote:
>Console.WriteLine( -8 ^ (1 / 3)) correctly gives -2.

The minus sign applies to the entire expression; it needs to apply to
8.
(-8) ^ (1 / 3) is NAN.
<blush>

Andrew
Sep 25 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mrwoopey | last post by:
Hi, My OLAP data cube is giving me the following error when I am manipulating OLAP data cube views: "the data being processed is over the allowed limit" I know that this message is caused by...
0
by: Fan Ruo Xin | last post by:
I installed Stinger in my PC (w2k). I need to do a quick compare between DB2 OLAP server and DB2 Cube Views. And I only found DB2 Cube Views version8.1 trial code from IBM website. I didn't want to...
2
by: Clint Olsen | last post by:
Hello: I posted a thread on comp.programming awhile back asking about an algorithm I implemented on square root. The idea was to use the square root of a prime number as a convenient way to get...
2
by: johnywalkyra | last post by:
Hello, first of all sorry for crossposting, but I could not decide which group is more appropriate. To my question: Recently I've came across the code in GCC standard library, which computes the...
11
by: lucidparadox | last post by:
I'm currently new to Python and I haven't been able to find the operator/math function to find the square root or even the x root of a number. I'm rewriting a program that I wrote in BASIC that...
0
by: Tim | last post by:
Hi Folks, I'm not certain if this is the correct group to post this question in, if there is a more appropriate one please advise. We have a cube that takes a little time to build, length of...
2
by: chitrapandy | last post by:
how to write a c program for this question. what is the concept behind this question. Assuming that a function f() and its derivative fprime() are provided, design a function to compute the roots...
4
by: sathyancse | last post by:
Hi, i found the new method of find cube root of the given value.i want to implement in the c++ program.ex: if you give the answer the certain value i find the cube value.(i.e)if you give the...
7
by: J-Burns | last post by:
Hello. Need some help here. I have a 4*4 cube. So the equation of the cube becoming: x + 4*y + 16*z Now i want to rotate this cube 90 degrees anticlockwise( a right rotation). How can i do...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.