forked from KolibriOS/kolibrios
370da47fa0
git-svn-id: svn://kolibrios.org@3584 a494cfbc-eb01-0410-851d-a64ba20cac60
22 lines
278 B
Perl
Executable File
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);
|
|
|