![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 deth ![]()
![]() |
本篇文章發表於2005-05-08 13:24
|
別忘捐VP感謝幫助你的人 | 新手會員瞧一瞧 |
1樓 |
java我不懂..
不過可以自己寫個絕對值函數 如果a小於0 則 a=a*(-1)
本篇文章回覆於2005-05-08 15:12
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
2樓 |
if (a<=0){
a=a*(-1); System.out.println(a); }else(a>0){ System.out.println(a); }
本篇文章回覆於2005-05-09 01:07
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
3樓 |
這應該有類似abs之類的函數吧
印象中每個語言幾乎都有
本篇文章回覆於2005-05-09 02:57
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
4樓 |
import java.lang.Math.*;
abs(long a) Returns the absolute value of a long value.
本篇文章回覆於2005-05-09 07:14
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
5樓 |
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html#abs(long)
abs public static long abs(long a)Returns the absolute value of a long value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. Note that if the argument is equal to the value of Long.MIN_VALUE, the most negative representable long value, the result is that same value, which is negative. Parameters: a - the argument whose absolute value is to be determined Returns: the absolute value of the argument. See Also: Long.MIN_VALUE
本篇文章回覆於2005-05-09 07:17
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
6樓 |
基本上Sun有提供完整的文件可供參考,下次您可以先搜尋文件看看喔!
本篇文章回覆於2005-05-15 11:58
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
7樓 |
哈哈...好手那個圖形好炫啊
還自己弄成印章喔 我也要來合成一個^___^a
本篇文章回覆於2005-05-15 18:19
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |