kolibrios/contrib/network/netsurf/libcss/test/data/parse/makefixed.pl
Yogev Ezra bb2bbc6b91 Move NetSurf to /contrib folder
git-svn-id: svn://kolibrios.org@4364 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-12-15 14:01:21 +00:00

22 lines
278 B
Perl
Executable File

#!/usr/bin/perl
use warnings;
use strict;
die "Usage: makefixed.pl <value>\n" if (@ARGV != 1);
my $val = shift @ARGV;
$val *= (1 << 10);
# Round away from zero
if ($val < 0) {
$val -= 0.5;
} else {
$val += 0.5;
}
# Truncates back towards zero
printf("0x%.8x\n", $val);