File: MSC.t

package info (click to toggle)
libmath-int64-perl 0.54-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 672 kB
  • ctags: 924
  • sloc: perl: 2,805; ansic: 320; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

use strict;
use warnings;

use Math::Int64 qw(string_to_uint64 uint64_to_number uint64);

use Test::More 0.88;

my $u = string_to_uint64('0xff00_0000_0000_0000');
my $nv = uint64_to_number($u);

ok($nv > 0, "uint64 to NV conversion");
ok($nv == (0xff00 * 0x10000 * 0x10000 * 0x10000), "uint64 to NV conversion 2");
ok($nv == $u, "uint64 to NV conversion 3") or diag ("nv converts to uint64 as " . uint64($nv) . ", expected: $u");

done_testing();