projects
/
urisagit/Sort-Maker.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
initial commit
[urisagit/Sort-Maker.git]
/
exp
/
endian2.pl
1
#!/usr/local/bin/perl
2
3
4
my $big_endian =
5
pack('N', 1) eq
6
pack('L', 1);
7
8
print "BIG\n" if $big_endian ;
9
10
11
12
sub float_sort ($) {
13
($big_endian ?
14
pack 'd', $_[0] :
15
reverse pack 'd', $_[0]) ^
16
($_[0] < 0 ? "\xFF" x 8 :
17
"\x80" . "\x00" x 7)
18
}
19
20