谁能确切的罗列下,delphi中整型和实型变量的取值范围?
整型是不是还分integer和Longint啊?

解决方案 »

  1.   

    基本语法问题,找找相关资料吧,整型份很多种的,byte,integer,word
      

  2.   

    看帮助Type Range Format
    Integer -2147483648..2147483647 signed 32-bit
    Cardinal 0..4294967295 unsigned 32-bit
    Fundamental integer types include Shortint, Smallint, Longint, Int64, Byte, Word, and Longword.Fundamental integer types  
    Type Range Format
    Shortint -128..127 signed 8-bit
    Smallint -32768..32767 signed 16-bit
    Longint -2147483648..2147483647 signed 32-bit
    Int64 -2^63..2^63-1 signed 64-bit
    Byte 0..255 unsigned 8-bit
    Word 0..65535 unsigned 16-bit
    Longword 0..4294967295 unsigned 32-bit
      

  3.   

    分类 范围 字节 备注 
    简单类型 序数 整数 Integer -2147483648 .. 2147483647 4 有符号32位 
    Cardinal 0 .. 4294967295 4 无符号32位 
    Shortint -128 .. 127 1 有符号8位 
    Smallint -32768 .. 32767 2 有符号16位 
    Longint -2147483648 .. 2147483647 4 有符号32位 
    Int64 -263 .. 263 8 有符号64位 
    Byte 0 .. 255 1 无符号8位 
    Word 0 .. 65535 2 无符号16位 
    Longword 0 .. 4294967295 4 无符号32位 
    字符 AnsiChar(Char) ANSI字符集  8位 
    WideChar Unicode字符集  16位 
    布尔 Boolean False < True
    Ord(False) = 0
    Ord(True) = 1
    Succ(False) = True
    Pred(True) = False 1  
    ByteBool False <> True
    Ord(False) = 0
    Ord(True) <> 0
    Succ(False) = True
    Pred(False) = True 1  
    WordBool 2  
    LongBool 4  
    枚举     
    子界     
    实数   Real 5.0×10-324 .. 1.7×10308 8 [精度]15..16 
    Real48 2.9×10-39 .. 1.7×1038 6 [精度]11..12;
    向后兼容 
    Single 1.5×10-45 .. 3.4×1038 4 [精度]7..8 
    Double 5.0×10-324 .. 1.7×10308 8 [精度]15..16 
    Extended 3.6×10-4951 .. 1.1×104932 10 [精度]19..20 
    Comp -263 + 1 .. 263 - 1 8 [精度]19..20 
    Currency -922337203685477.5808 .. 
    922337203685477.5807 8 [精度]19..20 
    字符串     ShortString 255个字符 2..256B 向后兼容 
    AnsiString 大约 231 个字符 4B..2GB 8位(ANSI)字符 
    WideString 大约 230 个字符 4B..2GB 多用户服务和
    多语言应用程序; 
    和com定义的BSTR兼容 
    其他 String
    String[0..255]
    PChar
    PAnsiString
    PWideString   
    结构类型 集合   Set 最多256个元素[0..255]   
    数组 静态数组       
    动态数组      
    记录   Record    
    文件   File    
    类   Class    
    类引用   Class reference    
    接口   Interface    
    指针类型 无类型指针   Pointer    
    有类型指针 预定义类型指针 PAnsiString
    PString
    PByteArray
    PCurrency
    PDouble
    PExtended
    PSingle
    PInteger
    POleVariant
    PShortString
    PTextBuf
    PVarRec
    PVariant
    PWideString
    PWordArray    
    过程类型 程序过程类型   Procedural    
    对象过程类型   Procedural     
    变体类型     Variant     
      OleVariant     
      

  4.   

    看看《Delphi 5开发人员指南》第2章
      

  5.   

    查官方的语言手册:一般来说整数的计算操作会返回Integer类型值,与32位Longint相同,运算元为Int64时,返回Int64类型值
      

  6.   

    Delphi技术手册看一下吧,对这此些有概括性的讲解
      

  7.   

    delphi热键:
       ctrl+shift +c
       ctrl+shift+i
       ctrl+shift+u
       ctrl+shift+向上键
       ctrl+shift+向下键
      
      

  8.   

    Integer 类型 取值范围 空间
    Integer –2147483648~2147483647 
    signed 32-bitCardinal 0~4294967295 
    unsigned 32-bitShortint –128~127 
    signed 8-bit
    Smallint –32768~32767 signed 16-bit
    Longint –2147483648~2147483647 signed 32-bit
    Int64 –263~263–1 s
    igned 64-bitByte 0~255 
    unsigned 8-bit
    Word 0~65535 
    unsigned 16-bit
    Longword 0~4294967 
    unsigned 32-bit
    Real类型 精度 取值范围 空间
    Real 15-16 5.0*10^-324~1.7*10^308 8B
    Single 7-8 1.5*10^45~3.4*10-38 4B
    Double 15-16 5.0*10^-324~1.7*10^308 8B
    Extended 19-20 3.6*10^-4951~1.1*10^4932 10B
    Currency 19-20 8B