kolibrios/programs/network/netsurf/libcss/test/data/parse/makefixed.pl
Dmitry Pereverzev (SoUrcerer) 370da47fa0 Netsurf initial port (still needs native ui and cURL)
git-svn-id: svn://kolibrios.org@3584 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-06-01 17:14:14 +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);