Opened 12 years ago

Closed 12 years ago

#316 closed bug (fixed)

Output of real is not accepted as input

Reported by: gorzel Owned by: hannes
Priority: minor Milestone: 3-1-3 and higher
Component: singular-kernel Version: 3-1-2
Keywords: Cc:

Description

The output of polys defined over real misses the * between the coefficient and the variables.

For basering complex it is OK.

> ring Rc =complex,x,dp;   // same as (real,t),x,dp
> Rc;
//   characteristic : 0 (complex:6 digits, additional 6 digits)
//   1 parameter    : i 
//   minpoly        : (i^2+1)
//   number of vars : 1
//        block   1 : ordering dp
//                  : names    x
//        block   2 : ordering C
> poly f = 0.0123*x2+0.03;
> f;
0.0123*x2+0.03                  // OK here, the output has the *
> short;
1
> poly g = 1.2x2+0.03;           // the input needs the *
   ? error occurred in or before STDIN line 44: `poly g = 1.2x2+0.03;`
   ? expected poly-expression. type 'help poly;'
   ? last reserved name was `poly`
   skipping text from `+`

But here the * is missing in the output.

> ring R = real,x,dp;
> poly f = 1.23x2+0.03;           // So the * is needed for the input
   ? error occurred in or before STDIN line 2: `poly f = 1.23x2+0.03;`
   ? expected poly-expression. type 'help poly;'
   ? last reserved name was `poly`
   skipping text from `+`
> poly f = 1.23*x2+0.03;        // With * accepted
> f;
1.230e+00x2+3.000e-02           // But now the * misses in the output
> poly g = 1.230e+00x2+3.000e-02;
   ? error occurred in or before STDIN line 5: `poly g = 1.230e+00x2+3.000e-02;`
   ? expected poly-expression. type 'help poly;'
   ? last reserved name was `poly`
   skipping text from `+`
> poly g = 1.230e+00*x2+3.000e-02;   // with the * accepted
> g;
1.230e+00x2+3.000e-02        

> short = 0;   // with short==0, it is certainly OK.
> g;
1.230e+00*x^2+3.000e-02        

Same problem with real and additional digits:

> ring R10 =(real,20,10),x,dp;
> basering;
//   characteristic : 0 (real:20 digits, additional 10 digits)
//   number of vars : 1
//        block   1 : ordering dp
//                  : names    x
//        block   2 : ordering C
> poly f = 0.0123*x2+0.03;
> f;                           // missing * here
0.0123x2+0.03
> poly g  = 0.0123x2+0.03;
   ? error occurred in or before STDIN line 11: `poly g  = 0.0123x2+0.03;`
   ? expected poly-expression. type 'help poly;'
   ? last reserved name was `poly`
   skipping text from `+`
> poly g  = 0.0123*x2+0.03;

Change History (1)

comment:1 Changed 12 years ago by hannes

Resolution: fixed
Status: newclosed

fixed.

Note: See TracTickets for help on using tickets.