Changeset f12d4f6 in git for kernel/mpr_complex.h


Ignore:
Timestamp:
Jul 29, 2004, 8:13:28 PM (20 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3c63794435207b2517c26dcc850fdf2d4c32a64f
Parents:
4a0d8619de8e3809d598fa74e5a0f8813326c7fe
Message:
*hannes: better rounding for long reals


git-svn-id: file:///usr/local/Singular/svn/trunk@7304 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/mpr_complex.h

    r4a0d86 rf12d4f6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mpr_complex.h,v 1.2 2004-04-28 13:31:36 Singular Exp $ */
     6/* $Id: mpr_complex.h,v 1.3 2004-07-29 18:13:28 Singular Exp $ */
    77
    88/*
     
    129129  inline operator double() const { return mpf_get_d( t ); };
    130130
     131#if 0
    131132  inline operator int() { return (int)mpf_get_d( t ); };
    132133  inline operator int() const { return (int)mpf_get_d( t ); };
     134#else
     135  inline operator int() const
     136  { if (mpf_fits_sint_p(t))
     137    {
     138      gmp_float tmp(*this);
     139      tmp+=gmp_float(0.5);
     140      return (int)mpf_get_si( tmp.t );
     141    }
     142    return 0;
     143  };
     144#endif 
    133145
    134146private:
Note: See TracChangeset for help on using the changeset viewer.