Changeset 3c6379 in git
- Timestamp:
- Jul 30, 2004, 2:18:50 PM (19 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 9995418f9a692786b393990b5d8ec6afc065e936
- Parents:
- f12d4f65e05f0c6728f1743580a54e40d44c0f21
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gnumpfl.cc
rf12d4f6 r3c6379 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1. 1.1.1 2003-10-06 12:15:53Singular Exp $ */4 /* $Id: gnumpfl.cc,v 1.2 2004-07-30 12:18:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floating-point numbers … … 118 118 { 119 119 if ( i == NULL ) return 0; 120 return (int)*(gmp_float*)i; 120 double d=(double)*(gmp_float*)i; 121 if (d<0.0) 122 return (int)(d-0.5); 123 else 124 return (int)(d+0.5); 121 125 } 122 126 -
kernel/mpr_complex.h
rf12d4f6 r3c6379 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: mpr_complex.h,v 1. 3 2004-07-29 18:13:28Singular Exp $ */6 /* $Id: mpr_complex.h,v 1.4 2004-07-30 12:18:50 Singular Exp $ */ 7 7 8 8 /* … … 31 31 * @short wrapper class for GNU Multi Precision Floats 32 32 */ 33 class gmp_float; 34 char *floatToStr( const gmp_float & r, const unsigned int oprec ); 33 35 class gmp_float 34 36 { … … 132 134 inline operator int() { return (int)mpf_get_d( t ); }; 133 135 inline operator int() const { return (int)mpf_get_d( t ); }; 134 #else136 //#else 135 137 inline operator int() const 136 138 { 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 } 139 { return (int)mpf_get_si( t ); } 142 140 return 0; 143 141 }; … … 165 163 gmp_float numberToFloat( number num ); 166 164 gmp_float numberFieldToFloat( number num, int k ); 167 char *floatToStr( const gmp_float & r, const unsigned int oprec );165 //char *floatToStr( const gmp_float & r, const unsigned int oprec ); 168 166 //<- 169 167
Note: See TracChangeset
for help on using the changeset viewer.