您的位置首页百科问答

0是一位数吗?0为什么不是一位数?最小的一位数

0是一位数吗?0为什么不是一位数?最小的一位数

的有关信息介绍如下:

0是一位数吗?0为什么不是一位数?最小的一位数

位数是指一个整数所占有数位的个数。把占有一个数位的数叫一位数,占有两个数位的数叫两位数。看百度上所有的说法都认为1是最小的一位数。但我在某个英文网站上看到了一个不同的说法,该网站上明确指出0 is one digits。希望有关于0是以为数吗?0是几位数?类似的问题我也很希望能得到完备的解释。

首先,介绍了十进制数的概念。

sign ::= ’+’ | ’-’

digit ::= ’0’ | ’1’ | ’2’ | ’3’ | ’4’ | ’5’ | ’6’ | ’7’ | ’8’ | ’9’

这里digit指的是10个阿拉伯数字

indicator ::= ’e’ | ’E’

digits ::= digit [digit]...

这里定义了digits的概念,就是几位数

decimal-part ::= digits ’.’ [digits] | [’.’] digits

exponent-part ::= indicator [sign] digits

infinity ::= ’Infinity’ | ’Inf’

nan ::= ’NaN’ [digits] | ’sNaN’ [digits]

numeric-value ::= decimal-part [exponent-part] | infinity

numeric-string ::= [sign] numeric-value | [sign] nan

where the characters in the strings accepted for infinity and nan may be in any case.

decNumber module这个函数计算数的结构,这里给出了一个计算某个数值是几位数的例子,分别是-1234.50,0和数字负无穷大。

Examples:If DECDPUN were 4,如果这个数是-1234.50the value -1234.50 would be encoded with:digits = 6exponent = -2bits = 0x80lsu = {3450, 12}数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,the value 0 would be:digits = 1exponent = 0bits = 0x00lsu = {0}–¥ (minus infinity) would be:digits = 1exponent = 0bits = 0xC0lsu = {0}

If DECDPUN were 4,如果这个数是-1234.50the value -1234.50 would be encoded with:digits = 6exponent = -2bits = 0x80lsu = {3450, 12}数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,the value 0 would be:digits = 1exponent = 0bits = 0x00lsu = {0}–¥ (minus infinity) would be:digits = 1exponent = 0bits = 0xC0lsu = {0}

If DECDPUN were 4,如果这个数是-1234.50the value -1234.50 would be encoded with:digits = 6exponent = -2bits = 0x80lsu = {3450, 12}数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,the value 0 would be:digits = 1exponent = 0bits = 0x00lsu = {0}–¥ (minus infinity) would be:digits = 1exponent = 0bits = 0xC0lsu = {0}

如果这个数是-1234.50the value -1234.50 would be encoded with:digits = 6exponent = -2bits = 0x80lsu = {3450, 12}数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,the value 0 would be:digits = 1exponent = 0bits = 0x00lsu = {0}–¥ (minus infinity) would be:digits = 1exponent = 0bits = 0xC0lsu = {0}

the value -1234.50 would be encoded with:digits = 6exponent = -2bits = 0x80lsu = {3450, 12}数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,the value 0 would be:digits = 1exponent = 0bits = 0x00lsu = {0}–¥ (minus infinity) would be:digits = 1exponent = 0bits = 0xC0lsu = {0}

digits = 6

exponent = -2

bits = 0x80

lsu = {3450, 12}

数0的各个参数的值为,这里很明确的指出数0的digits(几位数)是1,

the value 0 would be:

digits = 1

exponent = 0

bits = 0x00

lsu = {0}

–¥ (minus infinity) would be:

digits = 1

exponent = 0

bits = 0xC0

lsu = {0}

到这里,希望认为0不是一位数的人能意识到,可以认为0是一位数,而且认为0是一位数不是没有道理。