最近,我有16個長讀一些十六進制數據,如0x1000 0000 0000 0000
,但awk print long hex overflow?
16架F awk '{printf("0x\n", 0xffffffffffffffff)}'
,輸出0
awk '{printf("0x\n", 0x1000000000000000)}' output `0x1000000000000000` ok.
但是,相反
15f的awk '{printf("0x\n", 0xfffffffffffffff)}'
,輸出1000000000000000
(14 0)
15f的awk '{printf("0x\n", 0xfffffffffffffff0)}'
,OUTP UT 0
部14f awk '{printf("0x\n", 0xffffffffffffff)}'
,輸出100000000000000
(13 0)
部14f awk '{printf("0x\n", 0xffffffffffffff0)}'
,輸出100000000000000
(14 0)
部14f awk '{printf("0x\n", 0xffffffffffffff00)}'
,輸出0
13f中awk '{printf("0x\n", 0xfffffffffffff)}'
,輸出fffffffffffff
(13F)
13f中awk '{printf("0x\n", 0xfffffffffffff0)}'
,OUTP UT fffffffffffff0
(13F)
13f中awk '{printf("0x\n", 0xfffffffffffff00)}'
,輸出fffffffffffff00
(13F)
13f中awk '{printf("0x\n", 0xfffffffffffff000)}'
,輸出fffffffffffff000
(13F)
所以圖13F是確定,如何打印16F?
[在awk中打印長整數]的可能的重複(http://stackoverflow.com/questions/8857866/printing-long-integers-in-awk) – tripleee 2012-08-08 08:14:51
這打印了很多'0x',所以我想格式字符串剛剛關閉。 – TrueY 2013-04-21 16:19:31