cube roots vb.net 1

cube roots vb.net

Private Function CubedRoot(ByVal dNum As Double) As Double

        Return CType(CType(dNum ^ (1 / 3), Decimal), Double)

End Function

Here is what the above code is Doing:
1. The first line of code is a function declaration. It’s a function that takes a double as an argument and returns a double. The name of the function is CubedRoot.
2. The second line of code is the actual function. It’s a single line of code that takes the argument, raises it to the 1/3 power, converts it to a decimal, and then converts it back to a double.
3. The third line of code is the end of the function.

Now, let’s use the function. Here’s the code:

Similar Posts