473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 20315
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.WriteLi ne( -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.WriteLi ne( -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.WriteL ine( -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
2557
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 the size limit of each form field that is retrieved in the Request object is 102,399 bytes. The error occurs when I exceed this limit.
0
1809
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 spend a lot of time on this. So I installed the Cube Views 8.1, without uninstall ESE V8.2 code first last Friday. It looks like everything was OK. But I failed to start DB2 Information Center and DB2 CC today. I've seen process - javaw used...
2
3138
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 a pseudorandom number generator. So, rather than calculate the square root to try to get a particular precision answer, you would calculate it to x number of bits. This particular function takes a radicand and the number of iterations as...
2
9522
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 cube root of a real (floating point) number. Could anyone explain me the math behind the computation? Here's the snippet: ---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--
11
2308
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 does the math of a quadratic equation (user puts in a, b, and c values) and tells the user whether it has 1 root, 2 roots, or no real roots and displays the roots if it has real roots. Thanks in advance, Dan
0
1221
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 time varies by point in day and source SQL Server loading. While building the cube is 'off-line' and this is bothering the powers that be. As the underlying SQL Server data warehouse grows the time 'off-line' is bound to lengthen.
2
7766
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 of f(). Demonstrate how your function can be used to compute square root and cube root of a number n.
4
14670
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 ans 1331.i find the cube root is 11.i want to implement in the program please give some tips...
7
3180
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 that? The rotation must take place with the axis of rotation being the straight line through the center of the cube and perpendicular to the "xz-plane." The axis are aligned in this fashion:
0
8380
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.