小编mar*_*k4o的帖子

从整数转换为 IEEE 754 浮点数时舍入如何工作?

有许多值可以精确表示为 64 位,long但不能表示为 64 位double。(一个简单的例子:2 62 -1。)在给定间距的情况下,舍入是远离零、向零还是到最接近的可能值?

c floating-point precision rounding ieee-754

1
推荐指数
1
解决办法
128
查看次数

如何对第一列数据进行零填充

我在tab分隔的列中有这样的数据:

1   name1   attribute1
1   name1   attribute2
1   name1   attribute3
31  name2   attribute1
31  name2   attribute2
31  name2   attribute3
444 name3   attribute1
444 name3   attribute2
444 name3   attribute3
Run Code Online (Sandbox Code Playgroud)

我希望这样:

001 name1   attribute1
001 name1   attribute2
001 name1   attribute3
031 name2   attribute1
031 name2   attribute2
031 name2   attribute3
444 name3   attribute1
444 name3   attribute2
444 name3   attribute3
Run Code Online (Sandbox Code Playgroud)

我可以在unix或perl中执行此操作吗?

unix perl multiple-columns

0
推荐指数
1
解决办法
167
查看次数