Skip Menu |

This queue is for tickets about the Math-Complex CPAN distribution.

Report information
The Basics
Id: 132145
Status: open
Priority: 0/
Queue: Math-Complex

People
Owner: Nobody in particular
Requestors: pjacklam [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.59
Fixed in: (no value)



Subject: Inconsistent behaviour in **
The following should return -92.7965509003218 as a Perl scalar: $z = asinh(-1e+40); The following should return -92.7965509003218 as a Math::Complex object: $x = Math::Complex->new(-1e+40); $z = asinh($x); But both cases return the complex value -92.7965509003218 + 3.14159265358979i
Sorry for giving this ticket the wrong subject. This ticket describes a problem with "asinh()", not a problem with "**".
On Sat Mar 14 12:27:42 2020, pjacklam wrote: Show quoted text
> The following should return -92.7965509003218 as a Perl scalar: > > $z = asinh(-1e+40); > > The following should return -92.7965509003218 as a Math::Complex object: > > $x = Math::Complex->new(-1e+40); $z = asinh($x); > > But both cases return the complex value > > -92.7965509003218 + 3.14159265358979i
I think this could be fixed by modifying the termination of the asinh() implementation to return only the real component if ref($z) was untrue. That is, instead of terminating the asinh() sub with simply: return &log($t); terminate with something like (untested): my $ret = &log($t); return (@{$ret->cartesian})[0] unless ref($z); return $ret; Cheers, Rob