Data model - 数据模型

Data model
https://docs.python.org/3/reference/datamodel.html

数据模型
https://docs.python.org/zh-cn/3/reference/datamodel.html

1. numbers.Number

These are created by numeric literals and returned as results by arithmetic operators and arithmetic built-in functions. Numeric objects are immutable; once created their value never changes. Python numbers are of course strongly related to mathematical numbers, but subject to the limitations of numerical representation in computers.
此类对象由数字字面值创建,并会被作为算术运算符和算术内置函数的返回结果。数字对象是不可变的,一旦创建其值就不再改变。Python 中的数字当然非常类似数学中的数字,但也受限于计算机中的数字表示方法。

literal ['lɪt(ə)r(ə)l]:adj. 文字的,逐字的,无夸张的

Python distinguishes between integers, floating point numbers, and complex numbers:
Python 区分整型数、浮点型数和复数:

1.1 numbers.Integral

These represent elements from the mathematical set of integers (positive and negative).
此类对象表示数学中整数集合的成员 (包括正数和负数)。

There are two types of integers:
整型数可细分为两种类型:

1.1.1 Integers (int)

These represent numbers in an unlimited range, subject to available (virtual) memory only. For the purpose of shift and mask operations, a binary representation is assumed, and negative numbers are represented in a variant of 2’s complement which gives the illusion of an infinite string of sign bits extending to the left.
此类对象表示任意大小的数字,仅受限于可用的内存 (包括虚拟内存)。在变换和掩码运算中会以二进制表示,负数会以 2 的补码表示,看起来像是符号位向左延伸补满空位。

1.1.2 Booleans (bool)

These represent the truth values False and True. The two objects representing the values False and True are the only Boolean objects. The Boolean type is a subtype of the integer type, and Boolean values behave like the values 0 and 1, respectively, in almost all contexts, the exception being that when converted to a string, the strings “False” or “True” are returned, respectively.
此类对象表示逻辑值 False 和 True。代表 False 和 True 值的两个对象是唯二的布尔对象。布尔类型是整型的子类型,两个布尔值在各种场合的行为分别类似于数值 0 和 1,例外情况只有在转换为字符串时分别返回字符串 False 或 True。

The rules for integer representation are intended to give the most meaningful interpretation of shift and mask operations involving negative integers.
整型数表示规则的目的是在涉及负整型数的变换和掩码运算时提供最为合理的解释。

1.2 numbers.Real (float)

These represent machine-level double precision floating point numbers. You are at the mercy of the underlying machine architecture (and C or Java implementation) for the accepted range and handling of overflow. Python does not support single-precision floating point numbers; the savings in processor and memory usage that are usually the reason for using these are dwarfed by the overhead of using objects in Python, so there is no reason to complicate the language with two kinds of floating point numbers.
此类对象表示机器级的双精度浮点数。其所接受的取值范围和溢出处理将受制于底层的机器架构 (以及 C 或 Java 实现)。Python 不支持单精度浮点数;支持后者通常的理由是节省处理器和内存消耗,但这点节省相对于在 Python 中使用对象的开销来说太过微不足道,因此没有理由包含两种浮点数而令该语言变得复杂。

1.3 numbers.Complex (complex)

These represent complex numbers as a pair of machine-level double precision floating point numbers. The same caveats apply as for floating point numbers. The real and imaginary parts of a complex number z can be retrieved through the read-only attributes z.real and z.imag.
此类对象以一对机器级的双精度浮点数来表示复数值。有关浮点数的附带规则对其同样有效。一个复数值 z 的实部和虚部可通过只读属性 z.real 和 z.imag 来获取。

mercy ['mɜːsɪ]:n. 仁慈,宽容,怜悯,幸运,善行

2. Numeric Types - int, float, complex

There are three distinct numeric types: integers, floating point numbers, and complex numbers.
有三种不同的数字类型:整数、浮点数和复数。

Python 的数字类型包括 Integral (int、bool)、Real (float) 和 Complex (complex) 类型。

Data model - 数据模型相关推荐

  1. CRM的客户数据模型:Siebel Party Data Model (VI)

    关于Siebel CRM Thomas Siebel和 Patricia House 在1993成立了Siebel公司.起先由销售自动化产品起家,然后在扩展到更大的CRM市场.在20世纪90年代末,S ...

  2. 四、物理数据模型PDM(Physical Data Model )

    一.     PDM 介绍 物理数据模型(Physical Data Model)PDM,提供了系统初始设计所需要的基础元素,以及相关元素之间的关系:数据库的物理设计阶段必须在此基础上进行详细的后台设 ...

  3. 大数据入门9:半结构化数据模型(Semi-structured Data Model)

    文章目录 半结构化数据模型(Semi-structured Data Model) 1. 几种数据模型 2. 半结构化模型特征 3. XML和JSON 4. 树状数据结构(Tree Data Stru ...

  4. 【Hadoop】HBase 数据模型(Data Model)

    Data Model 在HBase中,数据是存储在有行有列的表格中.这是与关系型数据库重复的术语,并不是有用的类比.相反,HBase可以被认为是一个多维度的映射. HBase数据模型术语 Table( ...

  5. Data Model(数据模型)

    前言 最近开始使用PowerDesigner进行数据模型设计,看到下图突然间就想起来了大学所学<数据库系统概论>一书中的数据模型部分,随赶紧拿出来对照温习.真有种甘之如霖.醍醐灌顶的赶脚啊 ...

  6. SAP Cloud SDK‘s Virtual Data Model

    官网链接 SAP S/4HANA Cloud 和 On-Premise 公开的大部分服务都是 OData 服务. OData 是一种 RESTful API 协议,具有两个关键特性: 每个服务都由元数 ...

  7. 图解图库JanusGraph系列-一文知晓“图数据“底层存储结构(JanusGraph data model)

    图解图库JanusGraph系列-一文知晓"图数据"底层存储结构(JanusGraph data model) 大家好,我是洋仔,JanusGraph图解系列文章,实时更新 图数据 ...

  8. DSF data model

    Data Model指的是由DSF服务检索的数据的自然结构,创建一个debugger的用户接口的一个巨大挑战是:目标上可用的数据量远远大于实际提供给用户的数量.因此,调试服务需要将数据分解为具有适当粒 ...

  9. 概念模型 - Conceptual Data Model

    承接上一篇博客:数据模型 - Data Model 概念模型 1. 是现实世界到机器世界的一个中间层次 概念模型用于信息世界建模,是现实世界到信息世界的第一层抽象,是数据库设计人员进行数据库设计的有力 ...

最新文章

  1. 【学术】直博和读完硕士再读博,在能力上的差距有多大?
  2. jshell的安装使用
  3. 013.Zabbix的Items(监控项)
  4. 改进初学者的PID-手自动切换
  5. linux uname命令参数及用法详解--linux查看系统信息命令
  6. 银监会计算机知识点,2015国考银监会计算机专业考试分析
  7. BAJT 中高级 Java 面试题答案
  8. android之weex之component插件开发
  9. matlab求极值的函数
  10. 传奇架设教程GOM引擎微端设置方法
  11. 从达特茅斯会议到图灵奖---人工智能学习分享
  12. 不知道是真是假的流量购买---有待考察
  13. 《MySQL入门学习》(p61~p62)
  14. linux 释放内存
  15. XCOM Enemy Unknown
  16. SATA硬盘电源线或数据线引发的故障
  17. 分享一个火狐浏览器firefox的所有版本所有平台所有国家的地址
  18. 巨量算数 Data解密
  19. 【读论文-笔记】——1.沐神读Alexnet
  20. axure原型怎么让文字自动换行_Axure骚操作系列:“生成”手机APP

热门文章

  1. 完整的连接器设计手册_深度解析特斯拉的电池快充连接器技术|附视频
  2. 商学院全球化管理论坛 思科总裁林正刚作主题发言
  3. P2P下载器(Linux下C++项目实战)
  4. 专利CPC系统中,如何再次下载专利审查意见书?
  5. 【解决抓包工具fiddler不抓取360浏览器的数据的问题】
  6. 顺利完成网页版体温单
  7. asp前端日历_asp日历代码
  8. 去掉QQ迷你新闻的方法
  9. 红外成像与微光成像的区别
  10. 【JAVA】求出区间[a,b]中所有整数的质因数分解。