[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #38959] Conversion from complex double to int3
From: |
Clemens Buchacher |
Subject: |
[Octave-bug-tracker] [bug #38959] Conversion from complex double to int32 |
Date: |
Fri, 10 May 2013 09:58:29 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 |
URL:
<http://savannah.gnu.org/bugs/?38959>
Summary: Conversion from complex double to int32
Project: GNU Octave
Submitted by: drizzd
Submitted on: Fri 10 May 2013 09:58:28 AM GMT
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Clemens Buchacher
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.4
Operating System: Any
_______________________________________________________
Details:
The int32 conversion function refuses to convert complex input:
* Expected result:
> int32(1+1i)
ans = 1 + 1i
* Actual result:
> int32(1+1i)
error: invalid conversion from complex scalar to int32 scalar
The complex() function does not provide a workaround, since it converts int32
input to double output:
> complex(int32(1), int32(1))
ans = 1 + 1i
> class(complex(int32(1), int32(1)))
ans = double
Conversion functions for other types do not have this issue:
> single(1+1i)
ans = 1 + 1i
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38959>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #38959] Conversion from complex double to int32,
Clemens Buchacher <=