Singular Manual: number expressions

| ### 4.14.2 number expressions A number expression is: a rational number (there are NO spaces allowed inside a rational number, see int expressions) a floating point number (if the coefficient field is `real`): <digits>`.`<digits>`e`<sign><digits> an identifier of type number a function returning number an int expression (see Type conversion and casting) number expressions combined by the arithmetic operations `+`, `-`, `*`, `/`, `^`, or `**`. a type cast to number Example:
      // the following expressions are in any ring int expressions
      2 / 3;
    ==> // ** int division with `/`: use `div` instead in line >>  2 / 3;<<
    ==> 0
      4/ 8;
    ==> // ** int division with `/`: use `div` instead in line >>  4/ 8;<<
    ==> 0
      2 /2;   // the notation of / for div might change in the future
    ==> // ** int division with `/`: use `div` instead in line >>  2 /2;   // the\
        notation of / for div might change in the future<<
    ==> 1
      ring r0=0,x,dp;
      2/3, 4/8, 2/2 ; // are numbers
    ==> 2/3 1/2 1

      poly f = 2x2 +1;
      leadcoef(f);
    ==> 2
      typeof(_);
    ==> number
      ring rr =real,x,dp;
      1.7e-2; 1.7e+2; // are valid (but  1.7e2 not), if the field is `real`
    ==> (1.700e-02)
    ==> (1.700e+02)
      ring rp = (31,t),x,dp;
      2/3, 4/8, 2/2 ; // are numbers
    ==> 11 -15 1
      poly g = (3t2 +1)*x2 +1;
      leadcoef(g);
    ==> (3t2+1)
      typeof(_);
    ==> number
      par(1);
    ==> (t)
      typeof(_);
    ==> number
See Type conversion and casting; ring.

User manual for Singular version 4.3.2, 2023, generated by texi2html.