Changeset a2de54 in git for libpolys


Ignore:
Timestamp:
Jun 30, 2017, 2:58:42 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
541b207e61f595e837e6079db54d90568408ee06
Parents:
1744215efa55b9960a2e39b0ace7f4df0011ecee
Message:
use double instead of float, longer output
Location:
libpolys/coeffs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/gnumpc.cc

    r174421 ra2de54  
    383383
    384384    if ((p==NULL)
    385       && (6==r->float_len)
    386       && (6==r->float_len2)
     385      && (SHORT_REAL_LENGTH==r->float_len)
     386      && (SHORT_REAL_LENGTH==r->float_len2)
    387387      && (strcmp("i",n_ParameterNames(r)[0]) == 0)
    388388      )
     
    430430static void ngcCoeffWrite  (const coeffs r, BOOLEAN /*details*/)
    431431{
    432   Print("float[%s](complex:%d digits, additional %d digits)/(%s^2+1)",n_ParameterNames(r)[0],
     432  Print("real[%s](complex:%d digits, additional %d digits)/(%s^2+1)",n_ParameterNames(r)[0],
    433433        r->float_len, r->float_len2, n_ParameterNames(r)[0]);  /* long C */
    434434}
  • libpolys/coeffs/gnumpfl.cc

    r174421 ra2de54  
    503503static void ngfCoeffWrite  (const coeffs r, BOOLEAN /*details*/)
    504504{
    505   Print("float(real:%d digits, additional %d digits)",
     505  Print("real:%d digits, additional %d digits",
    506506               r->float_len,r->float_len2);  /* long R */
    507507}
  • libpolys/coeffs/numbers.h

    r174421 ra2de54  
    77* ABSTRACT: compatility interface to coeffs
    88*/
    9 #include "coeffs/coeffs.h"
     9#include "libpolys/coeffs/coeffs.h"
     10#include "omalloc/omalloc.h" /* for SIZEOF_DOUBLE, SIZEOF_LONG*/
    1011
    1112// the access methods
     
    5253// internal to coeffs, but public for all realizations
    5354
    54 #define SHORT_REAL_LENGTH 6 // use short reals for real <= 6 digits
     55#if SIZEOF_DOUBE == SIZEOF_LONG
     56#define SHORT_REAL_LENGTH 16 // use double for real <= 15 digits
     57#else
     58#define SHORT_REAL_LENGTH 6 // use float for real <= 6 digits
     59#endif
    5560
    5661/* the dummy routines: */
  • libpolys/coeffs/shortfl.cc

    r174421 ra2de54  
    8383{
    8484  assume( getCoeffType(r) == n_R );
    85   PrintS("float");  /* R */
     85  PrintS("real");  /* R */
    8686}
    8787
     
    282282  assume( getCoeffType(r) == n_R );
    283283
     284  #if SIZEOF_DOUBLE == SIZEOF_LONG
     285  char ch[16];
     286  int n = sprintf(ch,"%12.6e", nf(a).F());
     287  #else
    284288  char ch[11];
    285289  int n = sprintf(ch,"%9.3e", nf(a).F());
     290  #endif
    286291  if (ch[0] == '-')
    287292  {
Note: See TracChangeset for help on using the changeset viewer.