Math Calculation In Vb?
Jan 27, 2012I am trying to perform a simple multiplication in vb.
Below is my code:
Dim minus As Integer
Dim minusPrice As Integer
Dim totalPrice As Integer
[Code].....
I am trying to perform a simple multiplication in vb.
Below is my code:
Dim minus As Integer
Dim minusPrice As Integer
Dim totalPrice As Integer
[Code].....
I use Math.Tan(str) for example (str = 35)
I become 0.47... But how can I calculte it in Deg., and Grad., to?
This is a math calculation which is using factorial.
[Code]...
how to get the mantissa and exponent from a double in VB.net? I know I can do a string parse and some conversion to ints but I wondered if anyone had a mathematical equivalent formula that would allow me to do this?
View 1 RepliesI have a program that scans an image and converts gems to specific numbers. Look at the picture below:So i have a table with numbers. Number 1 is for yellow gem, 2 for blue, etc...
Like:
A B C D E
1 | 1 2 3 4 5
2 | 3 5 2 4 1
[code]....
I want to calculate a step, to get 3 equal numbers (gems) horizontally or vertically. For example, in this table if i swap E2 with D2, D2 will be 1, and D2,D3,D4 creates a valid step, because it's all 1. I'm using VB.NET 2010.My table is 8x8 size, it's just an example above.At now i'm just have the values in multiple variables (A1=1, A2=3, so on..)
well i am having a couple of issues with this particular homework problem and this is my first programming class so there is probably quite a few mistakes well the homework problem is to take three double values entered by a user and display the largest and smallest using math.max and math.min and display the smallest and largest so i thought i could use a listbox and take the values that went to the listbox and assign variables to each so i can try to use each variable in the math.max and min but im not making it to far and i actually might be way off
[Code]...
I need to store a calculation to use later and obtain a new calculation
[Code]...
I,m developing a debt calculation program 'my problem is when i have to calculate the months to pay back the debt it comes to 28.04 and i have to get it to 29 my code looks like this:
[Code]...
How can I round 4.39 to 5 in VB.NET? I tried:
Math.Round(4.39, 0)
But it displays 4.
I've been having a problem with Math.Log in a function I'm trying to write. When working with variables, it always returns 0. Here's the line I'm trying to run:
Quote:
mb = txtMb.Text
k = txtK.Text
t = txtT.Text
[Code].....
I am trying to use Math.round. now my math.round (2.5) converting it to 2. O want to convert it to 3.
View 6 RepliesI am trying to do math (-, +, *, etc) based on what a user selects from a combo box. The combo has the operators (-, +, *, /) in its items list. when the user selects one of them, I want to use that operator with the two numbers the user also provides from two text boxes.
dim intNumOne as integer
dim intNumTwo as integer
dim intAnswer as integer
[Code]....
'I don't think I want to concatenate here. but this is what I would like to happen (use the operator based on the users selection from the combo and the two numbers from the text boxes. I know I could write a select case or If statement but is there a way to do what I'm trying to do without Select Case or If? I tried to make theOperator a 'char' type variable but that didn't work either.
Is there any way to parse a string in vb.net (like, built in methods), that can do math like Eval can? For example, 3+(7/3.5) as a string would return 2.
I am not asking for you to code this for me, I just want to know if there is a built in way to do this, if there is not I will code it myself.
I can wager that it would not be able to parse stuff like Sin(90) on its own, and I understand that would need to be replaced by Math.Sin(90).
I have tried following coding to get highest value.EX: If I type 4.341111111111, It should get the value 4.35. If I type 9.132222, It should be 9.14 not 9.13.[code]
View 9 RepliesI am building a tool to figure out final value fees. This is the math i have to try to code
$1,000.01 or more 8.75% of the initial $50.00, plus 4.0% of the next $50.01 - $1,000.00, plus 2.0% of the remaining final sale price balance ($1,000.01 - final sale price)
I'm using .Net 3.51 SP1. I've been having problems with .Net's inability to add single numbers, could anyone throw some light on this.
[Code]...
I am trying to create a small application which does mathematical calculations using dates and times. Specifically, to determine the period of time between two specific dates and times.
View 2 RepliesI have a strange result coming from some big math & have no clue as to why I'm getting a different answer from vb.net vs python.Here are the quick snippets & results:
VB.NET
Dim MSB As UInt32 = 3067297518
Dim LSB As UInt32 = 1439785590
[code]......
I've a problem using simple logarithm function Log in some ButtonClick Event. Log is underlined with next warning:System.Diagnostics.Log is not accessible in this context because it is Friend.
Have I missed something or this happens because of the Express version of Visual Basic?
1. The lens equation for a camera is 1/f=1/di+1/de , where f is the focal length of the lens, is the distance between the lens and the film, and is the distance between the lens and the object. For a certain camera, an object that is 18 cm from the lens is in focus when the lens is 9 cm from the film. What is the focal length of the lens?
View 1 RepliesIs there some interface I can implement to allow basic comparisons and math to happen as it would an integer?
For example, let's say I have the following class:
Public Class Something
Public SomeBigNumber as UInt64
End Class
I would like to do something like this:
Dim SomethingA, SomethingB, SomethingC as New Something
....
If (SomethingA-SomethingB) > SomethingC Then
'Do stuff
End If
I was hoping to be able to implement some interface (if that is even the right term for it) that would return the UInt64 contained in the class for comparison and math, if possible.
I have to use a round method that follows this behavior:
7.00 -> round -> 7
7.50 -> round -> 7
7.51 -> round -> 8
I tried to use Math.Round, but it works a little bit different.
[Code]...
How can I implement my rounding logic?
How to get numbers from a text box then use them in a math operation.
View 4 RepliesSimilar in concept to Math.Abs() - I'm looking for a function that when given a positive integer will return the same integer. If given a negative, will return zero.
So:
f(3) = 3
f(0) = 0
f(-3) = 0
Yes, this is simple enough to write on my own but I'm wondering if the .NET Math class already has this built in or if the same can be achieved by cleverly chaining a few Math.* calls?
I am trying to figure out a calculation I can perform in C# to determine the rows per column. Let's say I know I am going to have 3 columns and my record count is 46. I know that I can mod the results to get a remainder, but I would like something more efficient than what I have tried. So I know I will have 16 rows per column with a remainder of 14 for the last column, but what is the best way to loop through the resutls and keep counts.
View 1 RepliesI have 36 numbers in sets of 5. (eg. 1-2-3-4-5, 2-3-4-5-6 etc..) I need to find all the possible combinations of these numbers which total the same sum. For instance the lowest sum would be: 1 + 2 + 3 + 4 + 5 = 15. The highest possible sum is: 32 + 33 + 34 + 35 + 36 = 170. Now every five number combination within these 36 numbers will sum up between 15 and 170. How would I go about this in vb.net to produce all the possible combinations which would total say 92.
View 6 RepliesFor some reason the exception is caught sometimes it's not?Here is the code:
[code]...
does VB.NET include the Mathematical Integration/Derivation functions in the Library? If so where are
they, I couldn't find them? If not, any third-party libraries you would recommend?
Im working with a Picturebox in VB using the following basic math equations. [code]I believe that this equation assumes I am working in a coordinate plane where the following is true (0,0) is the bottom left corner of the Positive quadrant
-x increases as you move right
-y increases as you move up
I am working in a coordinate plane where the following is true (0,0) is the Top left corner of the positive quadrant
-X increases as you move right
-Y increases as you move down
The issue is I am not sure how this will affect my original equation for intersection point.
I'm having a problem with the Math.Abs statement. When I try to use this statement to figure the absolute value of a number, as in:
View 3 Replies