asp中clng 函式溢位問題

2022-02-24 18:19:54 字數 1184 閱讀 3136

1樓:匿名使用者

cdbl(135232776239)

就不溢位了

2樓:張小剛愛生活

clng與cint的區別及防溢位函式

cint與clng含義:

都可以強制將一個表示式轉換成資料型別

cint與clng處理資料的範圍:

cint integer -32,768 至 32,767,小數部分四捨五入。

clng long -2,147,483,648 至 2,147,483,647,小數部分四捨五入。

所謂溢位指的是超出處理資料的範圍,下面**是處理資料防止溢位的**,大家可以自己看看:

'檢測是否是短整數

sub is_lng(string)

if len(abs(string))>10 then response.write "資料溢位":response.end

if instr(string,"-")<1 then

if cint(left(string,4))>3276 and cint(right(string,1))>7 then response.write "資料溢位":response.

endelse

if cint(left(abs(string),4))>3276 and cint(right(string,1))>8 then response.write "資料溢位":response.

endend if

end sub

'檢測是否是長整數

sub is_lng(string)

if len(abs(string))>10 then response.write "資料溢位":response.end

if instr(string,"-")<1 then

if clng(left(string,9))>214748364 and clng(right(string,1))>7 then response.write "資料溢位":response.

endelse

if clng(left(abs(string),9))>21478364 and clng(right(string,1))>8 then response.write "資料溢位":response.

endend if

end sub

asp時間函式,asp中,獲取當前時間的函式是什麼

基本函式 date 建立日期變數,顯示格式 2004 2 28 time 建立時間變數,顯示格式 22 24 59 now 建立日期和時間變數,顯示格式 2005 5 2 22 37 30 單獨獲取年 月 日 時 分 秒 先建立日期變數d date 獲取年份 year d 獲取月份 month d ...

關於getline函式的輸出問題

istream getline istream is,string str,char delim istream getline istream is,string str 將輸入流is中讀到的字元存入str中,直到遇到終結符delim才結束。對於第一個函式delim是可以由使用者自己定義的終結符 ...

ASP中關於session的提示問題

在中我們一般不會把登陸驗證寫在前臺頁面裡,初學者也是把它寫在後臺頁面的page load事件裡,並用ispostback判斷是否是回傳,如果不是則進行登入驗證。而且你的那個set類是做什麼的因為沒用過,也不太清楚,不過一般驗證只是判斷這個session是否為空,如果不為空就說明登入了,因為在每次瀏覽...