File: mbi_ltm_bugs.t

package info (click to toggle)
libcryptx-perl 0.087-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,212 kB
  • sloc: ansic: 59,240; perl: 3,828; pascal: 2,612; makefile: 201
file content (26 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!perl

use strict;
use warnings;

use Test::More;

BEGIN {
  plan skip_all => "requires Math::BigInt" unless eval { require Math::BigInt };
  plan tests => 2;
}

use Math::BigInt lib => 'LTM';

my $V = $Math::BigInt::VERSION;

# https://github.com/DCIT/perl-CryptX/issues/56
{
  my ($x, $y);
  $x = Math::BigInt->new("2");
  $y = Math::BigInt->new("-1");
  is($x ** $y, $V < 1.999817 ? 'NaN' : 0);
  $x = Math::BigInt->new("-2");
  $y = Math::BigInt->new("-2");
  is($x ** $y, $V < 1.999817 ? 'NaN' : 0);
}