[system] / trunk / pg / lib / Value / Complex.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/Complex.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3715 Revision 3716
11 '+' => sub {shift->add(@_)}, 11 '+' => sub {shift->add(@_)},
12 '-' => sub {shift->sub(@_)}, 12 '-' => sub {shift->sub(@_)},
13 '*' => sub {shift->mult(@_)}, 13 '*' => sub {shift->mult(@_)},
14 '/' => sub {shift->div(@_)}, 14 '/' => sub {shift->div(@_)},
15 '**' => sub {shift->power(@_)}, 15 '**' => sub {shift->power(@_)},
16 '.' => \&Value::_dot, 16 '.' => sub {shift->_dot(@_)},
17 'x' => sub {shift->cross(@_)}, 17 'x' => sub {shift->cross(@_)},
18 '<=>' => sub {shift->compare(@_)}, 18 '<=>' => sub {shift->compare(@_)},
19 'cmp' => sub {shift->compare_string(@_)}, 19 'cmp' => sub {shift->compare_string(@_)},
20 '~' => sub {shift->conj}, 20 '~' => sub {shift->conj},
21 'neg' => sub {shift->neg}, 21 'neg' => sub {shift->neg},
333 333
334# acoth(z) = (1/2) log((1+z)/(z-1)) 334# acoth(z) = (1/2) log((1+z)/(z-1))
335sub acoth {my $z = promote(@_); CORE::log((1+$z)/($z-1))/2} 335sub acoth {my $z = promote(@_); CORE::log((1+$z)/($z-1))/2}
336 336
337################################################## 337##################################################
338
339sub pdot {
340 my $self = shift;
341 my $z = $self->stringify;
342 return $z if $z !~ /[-+]/;
343 return "($z)";
344}
338 345
339sub string {my $self = shift; Value::Complex::format(@{$self->data},'string',@_)} 346sub string {my $self = shift; Value::Complex::format(@{$self->data},'string',@_)}
340sub TeX {my $self = shift; Value::Complex::format(@{$self->data},'TeX',@_)} 347sub TeX {my $self = shift; Value::Complex::format(@{$self->data},'TeX',@_)}
341 348
342# 349#

Legend:
Removed from v.3715  
changed lines
  Added in v.3716

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9