~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Lib/python/pycomplex.swg

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
%define %swig_fromcplx_conv(Type, Real, Imag)
12
12
%fragment(SWIG_From_frag(Type),"header")
13
13
%{
14
 
SWIGINTERNSHORT PyObject*
 
14
SWIGINTERNINLINE PyObject*
15
15
  SWIG_From(Type)(SWIG_cplusplus(const Type&, Type) c)
16
16
{
17
17
  return PyComplex_FromDoubles(Real(c), Imag(c));
34
34
  } else {
35
35
    double d;    
36
36
    if (SWIG_AsVal(double)(o, &d)) {
37
 
      if (val) *val = Constructor(d, 0);
 
37
      if (val) *val = Constructor(d, 0.0);
38
38
      return 1;
39
39
    } else {
40
40
      PyErr_Clear();
73
73
    double re;    
74
74
    if (SWIG_AsVal(double)(o, &re)) {
75
75
      if (SWIG_CheckDoubleInRange(re, -FLT_MAX, FLT_MAX, errmsg)) {
76
 
        if (val) *val = Constructor(SWIG_numeric_cast(re,float), 0);      
 
76
        if (val) *val = Constructor(SWIG_numeric_cast(re,float), 0.0);      
77
77
        return 1;
78
78
      } else {
79
79
        return 0;