Changeset 6c4df47 in git


Ignore:
Timestamp:
Jun 23, 1999, 10:26:43 AM (24 years ago)
Author:
Moritz Wenk <wenk@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
6b9e9c662b8c35931dfedb7053c0c6d2597e5f68
Parents:
8c42949b7b17868cb7c7f501a82f0f67bed167f3
Message:
* fixed error in ngfPower


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

Legend:

Unmodified
Added
Removed
  • Singular/gnumpfl.cc

    r8c42949 r6c4df47  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpfl.cc,v 1.3 1999-05-10 15:10:49 Singular Exp $ */
     4/* $Id: gnumpfl.cc,v 1.4 1999-06-23 08:26:43 wenk Exp $ */
    55/*
    66* ABSTRACT: computations with GMP floating-point numbers
     
    242242  if ( exp == 0 )
    243243  {
    244     *(gmp_float*)u= 1.0;
     244    *(gmp_float*)u= (gmp_float)1.0;
    245245    return;
    246246  }
     
    249249    if ( x == NULL )
    250250    {
    251       *(gmp_float*)u= 0.0;
     251      *(gmp_float*)(*u) = (gmp_float)0.0;
    252252    }
    253253    else
    254254    {
    255       *(gmp_float*)u= *(gmp_float*)x;
     255      *(gmp_float*)(*u) = *(gmp_float*)x;
    256256    }
    257257    return;
    258258  }
     259
    259260  ngfPower(x,exp-1,u);
    260   *(gmp_float*)u*= *(gmp_float*)x;
     261
     262  *(gmp_float*)(*u) *= *(gmp_float*)x;
     263
    261264}
    262265
     
    398401{
    399402  char *out;
    400 //Print("ngfWrite %d\n",gmp_output_digits);
    401   out= floatToStr(*(gmp_float*)a,gmp_output_digits);
    402   StringAppend(out);
    403 
    404   Free((ADDRESS)out, (strlen(out)+1)* sizeof(char) );
     403  if ( a ) {
     404    out= floatToStr(*(gmp_float*)a,gmp_output_digits);
     405    StringAppend(out);
     406    //Free((ADDRESS)out, (strlen(out)+1)* sizeof(char) );
     407    FreeL( (ADDRESS)out );
     408  } else {
     409    StringAppend("0");
     410  }
    405411}
    406412
Note: See TracChangeset for help on using the changeset viewer.