Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3584 sourcerer 1
#!/usr/bin/perl
2
 
3
use warnings;
4
use strict;
5
 
6
die "Usage: makefixed.pl \n" if (@ARGV != 1);
7
 
8
my $val = shift @ARGV;
9
 
10
$val *= (1 << 10);
11
 
12
# Round away from zero
13
if ($val < 0) {
14
	$val -= 0.5;
15
} else {
16
	$val += 0.5;
17
}
18
 
19
# Truncates back towards zero
20
printf("0x%.8x\n", $val);
21