使用 VB.NET 将负整数转换为正整数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20182568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Convert negative integer to positive using VB.NET
提问by Dan
How to convert negative integer to positive integer using vb.net ? Also if there is a function in SQL Server 2008 to do the same concept ?
如何使用 vb.net 将负整数转换为正整数?另外如果在 SQL Server 2008 中有一个函数来做同样的概念?
回答by Mitch Wheat
回答by Rose
Regardless of the language you're programming in. You can multiply any number by -1 to change the number's sign.
无论您使用哪种语言编程。您可以将任何数字乘以 -1 来更改数字的符号。
-5 * -1 = 5
5 * -1 = -5
回答by Andrey
Abs()in SQL Serverand Math.Abs()in VB.NET
Abs()在SQL服务器和Math.Abs()在VB.NET

