ASP/VBScript-Int()与CInt() [英] ASP/VBScript - Int() vs CInt()

查看:69
本文介绍了ASP/VBScript-Int()与CInt()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Int()CInt()之间的ASP/VBScript有什么区别?

What is the difference in ASP/VBScript between Int() and CInt()?

推荐答案

  • Int()
    • Int()
    • Int函数返回指定数字的整数部分.

      The Int function returns the integer part of a specified number.

      • CInt()
        • CInt()
        • CInt函数将表达式转换为Integer类型.

          The CInt function converts an expression to type Integer.

          最好的答案来自 MSDN

          CInt与Fix和Int函数不同,后者会截断而不是舍入数字的小数部分.当小数部分正好为0.5时,CInt函数始终将其四舍五入为最接近的偶数.例如,将0.5舍入为0,将1.5舍入为2.

          CInt differs from the Fix and Int functions, which truncate, rather than round, the fractional part of a number. When the fractional part is exactly 0.5, the CInt function always rounds it to the nearest even number. For example, 0.5 rounds to 0, and 1.5 rounds to 2.

          这篇关于ASP/VBScript-Int()与CInt()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆