Changeset 2082b6 in git


Ignore:
Timestamp:
Jul 8, 1999, 6:44:03 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
58ce10a42ffe9e3efdfe86dbd440815c71d053d9
Parents:
b719a30005f8bcbcca9d638b7908dda038ffee56
Message:
*hannes: handling of a/b


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

Legend:

Unmodified
Added
Removed
  • Singular/gnumpfl.cc

    rb719a3 r2082b6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpfl.cc,v 1.7 1999-07-02 16:14:39 wenk Exp $ */
     4/* $Id: gnumpfl.cc,v 1.8 1999-07-08 16:44:03 Singular Exp $ */
    55/*
    66* ABSTRACT: computations with GMP floating-point numbers
     
    241241{
    242242  if ( exp == 0 )
    243   { 
     243  {
    244244    gmp_float* n = new gmp_float(1);
    245     *u=(number)n; 
     245    *u=(number)n;
    246246    return;
    247247  }
     
    258258      gmp_float* n = new gmp_float();
    259259      *n= *(gmp_float*)x;
    260       *u=(number)n; 
     260      *u=(number)n;
    261261    }
    262262    return;
     
    389389  else
    390390  {
    391     if ( *s == '/' ) {
     391    gmp_float divisor(1.0);
     392    char *start2=s;
     393    if ( *s == '/' )
     394    {
     395      s++;
     396      s= ngfEatFloatNExp( s );
     397      if (s!= start2+1)
     398      {
     399        char tmp_c=*s;
     400        *s='\0';
     401        divisor.setFromStr(start2+1);
     402        *s=tmp_c;
     403      }
     404      else
     405      {
     406        Werror("wrong long real format: %s",start2);
     407      }
    392408    }
    393     char c=*s;
    394     *s='\0';
     409    char c=*start2;
     410    *start2='\0';
    395411    if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float();
    396412    (*(gmp_float**)a)->setFromStr(start);
    397     *s=c;
    398   }
    399 
    400  
     413    *start2=c;
     414    (**(gmp_float**)a) /= divisor;
     415  }
    401416
    402417  return s;
     
    409424{
    410425  char *out;
    411   if ( a ) {
     426  if ( a != NULL )
     427  {
    412428    out= floatToStr(*(gmp_float*)a,gmp_output_digits);
    413429    StringAppend(out);
    414430    //Free((ADDRESS)out, (strlen(out)+1)* sizeof(char) );
    415431    FreeL( (ADDRESS)out );
    416   } else {
     432  }
     433  else
     434  {
    417435    StringAppend("0");
    418436  }
Note: See TracChangeset for help on using the changeset viewer.