概览
参照该文里的两个表格来了解Q的数据类型。其中:
- type:类型名称
- size:该类型占用多少个字节
- char type:该类型的单字符代号,可以跟在值后面表示类型,例如1b表示boolean的true
- num type:该类型的数字代号,type命令可以用来查看一个变量的类型,以数字代号表示。数字前面带-号表示原子类型,不带-号表示是该原子类型的列表
type 0Nj -7h type (1j;2j) 7h
注意KDB 3.1以后默认类型有些变化,例如原来一个数字默认是int,3.1之后默认是long
type 0Ni -6h type 0Nj -7h type 0N -7h
浮点数
float类型的精度不少于15位小数,real类型的精度不少于6位小数。注意q控制台显示值的时候值显示7位精度的数字,例如
q)1.123456789 1.123457 q)1.123456789e 1.123457e
可以通过“\P”命令更改显示精度
q)\P 16 q)1.123456789 1.123456789 q)1.123456789e 1.123456835746765e
二进制数据
包括boolean和byte。0b是false,1b是true。byte用16进制表示,如0x2a。二进制数据可以当作数值参与计算。
文本数据
包括char和symbol。
char是单字符,使用\作特殊符号的转义符,例如"\"","\n"等。也支持反斜杠后跟数字表示ASCII,如"\142"表示”b"。
symbol以`开头。symbol与string的区别
- string是一个char列表,而symbol是不能再拆分的原子类型,它并不是由char组成,例如我们可以取得一个string的第几个字符,而symbol则没有这种做法
q)"abc"[0] "a" q)`abc[0] 'abc
`$"A symbol with `backtick"
相关推荐
SQL Queries for Mere Mortals A Hands-On Guide to Data Manipulation in SQL(4th) 英文epub 第4版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
SQL Queries for Mere Mortals has earned worldwide praise as the clearest, simplest tutorial on writing effective queries with the latest SQL standards and database applications. Now, author John L. ...
SQL Queries for Mere Mortals A Hands-On Guide to Data Manipulation in SQL, 3rd Edition truePDF无水印
You need UML for Mere Mortals™. This easy-to-read introduction is perfect for technical professionals and business stakeholders alike: anyone who needs to create, understand, or review UML models, ...
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks.
Database Design For Mere Mortals 英文 第二版
Hernandez’s best-selling Database Design for Mere Mortals® has earned worldwide respect as the clearest, simplest way to learn relational database design. Now, he’s made this hands-on, software-...
SQL Queries for Mere Mortals(3rd) 英文epub 第3版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
SQL_Queries_For_Mere_Mortals(SQL 凡人入们查询)的配套光盘资料,包括书中样例数据库sql脚本以及查询脚本.
SQL.Queries.for.Mere.Mortals
VSTO 原版著作 office 开发必备
用户界面设计,比较经典的一本书!不知道以前有人上传没有!
The #1 Easy, Common-Sense Guide to SQL Queries—Updated with More Advanced Techniques and Solutions
Database.Design.for.Mere.Mortals.3rd.Edition.2013.2
Addison.Wesley.User.Interface.Design.for.Mere.Mortals 界面设计方面的好书
“这本书是我知道VSTO和.NET Framework后,最想得到的一本书。这本书对于那些使用VSTO的人和任何想从Office VBA转到VB.NET上来的人来说都是非常有用的。书中所讲的大量主题提供了比MSDN或其它任何地方都更深层次和以...
链接到“ Q for Mortals”一书: : Kdb +下载: ://kx.com/developers/download-licenses/ 下载完成后,在终端上在Linux上运行〜/ q / l32 / q或在Windows上运行。\ q \ w32 \ q来打开q控制台 要退出控制台,请...