小编Ari*_*ury的帖子

bash:糟糕的替代

#!/bin/bash

jobname="job_201312161447_0003"
jobname_pre=${jobname:0:16}
jobname_post=${jobname:17}
Run Code Online (Sandbox Code Playgroud)

这个bash脚本在Ubuntu上给了我错误的替换错误.任何帮助将受到高度赞赏.

string bash ubuntu substitution

116
推荐指数
7
解决办法
20万
查看次数

float和Decimal的模数和整数除法的不同结果

我对行为很困惑,如下所示:

>>> (-7) % 3 
2
>>> Decimal('-7') % Decimal('3') 
Decimal('-1')
>>> 

>>> (-7) // 3
-3
>>> Decimal('-7') // Decimal('3') 
Decimal('-2')
>>>
Run Code Online (Sandbox Code Playgroud)

有人可以解释一下吗?

python python-3.x

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

标签 统计

bash ×1

python ×1

python-3.x ×1

string ×1

substitution ×1

ubuntu ×1