#92 numer and float problem.

closed
nobody
5
2008-01-28
2002-07-25
Raymond Toy
No

Consider this simple transcript with CMUCL with current
sources:

(C1) exp(1);

(D1) %E
(C2) ev(%,numer);

(D2) %E
(C3) float(%);

(D3) 2.718281828459045
(C4) exp(2);

2
(D4) %E
(C5) ev(%,numer);

(D5) 7.389056
(C6) float(d4);

(D6) 7.389056

Why is D2 still %E? Shouldn't it be the same as D3?

And why does D5 and D6 only have single precision
results? They ought to be at least double precision.
Clisp has the same problem. GCL doesn't since
single-float and double-float are the same on GCL.

Discussion

  • Raymond Toy
    Raymond Toy
    2004-11-09

    Logged In: YES
    user_id=28849

    float(exp(2)) should return a double-float now.
    float(exp(n)) when n is an integer should be a double-float too.

     
  • Robert Dodier
    Robert Dodier
    2005-08-02

    Logged In: YES
    user_id=501686

    I get similar output, except that now all numerical values
    are doubles as expected ---

    (%i21) exp(1);
    (%o21) %e
    (%i22) ev(%,numer);
    (%o22) %e
    (%i23) float(%);
    (%o23) 2.718281828459045
    (%i24) exp(2);
    (%o24) %e^2
    (%i25) ev(%,numer);
    (%o25) 7.38905609893065
    (%i26) float (%o24);
    (%o26) 7.38905609893065
    (%i27) float(exp(4));
    (%o27) 54.59815003314424

    Compare these to %i22/%o22 ---

    (%i28) %e, numer;
    (%o28) 2.718281828459045

    (%i37) :lisp (setq $% '((mexpt) $%e 1))
    ((MEXPT) $%E 1)
    (%i37) %, numer;
    (%o37) 2.718281828459045

    Hmm.

    Maxima version: 5.9.1.1cvs
    Maxima build date: 10:5 7/28/2005
    host type: i686-redhat-linux-gnu
    lisp-implementation-type: CLISP
    lisp-implementation-version: 2.33.2 (2004-06-02)

     
  • Robert Dodier
    Robert Dodier
    2005-08-02

    • labels: --> 460522
     
  • Robert Dodier
    Robert Dodier
    2006-03-26

    Logged In: YES
    user_id=501686

    See also [ 531466 ] float needs to be eval. with numer (more
    of the same, with different examples).

     
  • Robert Dodier
    Robert Dodier
    2006-08-27

    • labels: 460522 --> Lisp Core - Floating point
     
  • Dan Gildea
    Dan Gildea
    2008-01-27

    • status: open --> pending
     
  • Dan Gildea
    Dan Gildea
    2008-01-27

    Logged In: YES
    user_id=1797506
    Originator: NO

    I think this is by design: you need %enumer to get the numeric value of %e.

    (%i9) exp(1);
    (%o9) %e
    (%i10) ev(%,numer,%enumer);
    (%o10) 2.718281828459045

     
  • Robert Dodier
    Robert Dodier
    2008-01-28

    • status: pending --> closed
     
  • Robert Dodier
    Robert Dodier
    2008-01-28

    Logged In: YES
    user_id=501686
    Originator: NO

    Closing this one as a duplicate of [ 609464 ] 1+%e,numer and %e^%e,numer. The single vs double precision floating stuff seems to have been resolved some time ago.