Click here to Skip to main content
16,022,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm doing a calculator project and i finish but thing remain is, can i do if a user want to check the absolute value of a number?
I tried my all best in order to use math class for abs but the news is bad so i need your help bye.
Posted
Comments
[no name] 2-Apr-12 10:16am    
What have you tried? Math.Abs(some value) is pretty straight-forward
[no name] 2-Apr-12 10:38am    
but the news is bad so i need your help
If you want help then learn to explain exactly what your code is trying to do, what results you expect, and what results you actually get. Statements like this are no use at all.

1 solution

If you can't work out how to use a class, or a property, or a method, the first thing to do is try MSDN:
Google: "MSDN Math.Abs"[^]
The result you want is normally near or at the top:
MSDN: Math.Abs Method[^]
This shows the various overloads, so pick the appropriate one: Math.Abs(Double)[^]
This has a good description, and even an example!
Dim absoluteValue As Double = Math.Abs(1234.7123)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900