diff options
author | Zheng Bao <fishbaozi@gmail.com> | 2012-09-24 14:05:22 +0800 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-09-24 09:19:26 +0200 |
commit | cf329ffac87e6006d1c970b8b5800355048526a4 (patch) | |
tree | b747bb0caa0b6494606cfa99d641037ba3de7f76 /util/nvramtool/cli | |
parent | 1d668973645895faedff890ab96d1db9a187dcc2 (diff) | |
download | coreboot-cf329ffac87e6006d1c970b8b5800355048526a4.tar.xz |
AMD hudson: Round the float pointing number to integer
Try
sh> printf %d 0x005500AA | LC_ALL=C awk '{printf("%c%c%c%c", \
$1 % 256, $1/256 % 256, $1/65536 % 256, $1/16777216);}' | \
od -Ax -t x
On Linux with gawk, we get
000000 005500aa
000004
On FreeBSD with nongnu-awk, we get
000000 000055aa
000002
In awk, all the numbers are floating point number. So division doesn't
round the result from 0.75 (3/4) to 0.
And, There is a fact that, for the FreeBSD awk,
sh> awk 'BEGIN {printf("%c", 0.75)}';
produces nothing, instead of 0.
Here we need to convert the floating point number to
integer by int(X), which is an awk built-in function, instead of GNU
extension.
Change-Id: I3470d5f13e7ea59a978d5575a54c0d56368dc78d
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1529
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'util/nvramtool/cli')
0 files changed, 0 insertions, 0 deletions