| 1 | package AI::Prolog::Term::Number; | ||||||||||||||||||||||||||||
| 2 | 13 | $REVISION = '$Id: Number.pm,v 1.3 2005/02/28 02:32:11 ovid Exp $'; | |||||||||||||||||||||||||||
| 3 | 13 | $VERSION = '0.1'; | |||||||||||||||||||||||||||
| 4 | 13 | @ISA = 'AI::Prolog::Term'; | |||||||||||||||||||||||||||
| 5 | 13 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 13 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 13 | ▶ | use Scalar::Util qw/looks_like_number/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 13 | ▶ | use aliased 'AI::Prolog::Term'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 102 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 102 | my ($proto, $number) = @_; | |||||||||||||||||||||||||||
| 13 | 102 | my $self = $proto->SUPER::new($number, 0); | |||||||||||||||||||||||||||
| 14 | 102 | ▶ | $self->{varid} = defined $number && looks_like_number($number) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $number and &looks_like_number($number)
MC/DC50%1/2
defined $number and &looks_like_number($number)
defined $number
&looks_like_number($number)
Truth table66%2/3
A and B
A= defined $numberB= &looks_like_number($number)
| |||||||||||||||||||||||||||||
| 15 | ? $number | ||||||||||||||||||||||||||||
| 16 | : 0; | ||||||||||||||||||||||||||||
| 17 | 102 | return $self; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 92 | ▶ | sub value { shift->{varid} } | ||||||||||||||||||||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 1 | ▶ | sub dup { # should this be recast as the parent? | ||||||||||||||||||||||||||
|
Subroutine
dup: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 24 | 1 | return $self->new($self->{varid}); | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 13 | 1; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | __END__ | ||||||||||||||||||||||||||||