initial commit
[urisagit/Sort-Maker.git] / exp / endian2.pl
CommitLineData
7468c584 1#!/usr/local/bin/perl
2
3
4my $big_endian =
5 pack('N', 1) eq
6 pack('L', 1);
7
8print "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