[Prev][Next][Index][Thread]

# Re: eval / toliteral safety question

- Date: Tue, 11 Jun 1996 19:37:32 PDT
- From:
- Reply-To:
- Content-Transfer-Encoding: quoted-printable
- Content-Type: text/plain; charset=ISO-8859-1
- Newsgroups: local.moo
- Organization: Where Stormnet meets the Internet
- References: <199606111344.JAA09446@rabbit.INS.CWRU.Edu>

    Followup to:  <199606111344.JAA09446@rabbit.INS.CWRU.Edu>
    By author:    "Seth I. Rich" <sir@po.cwru.edu>
    In newsgroup: local.moo
    >
    > Is there EVER a circumstace where
    >   eval("return " + toliteral(x) + ";")[2]
    > would not equal x?  Can anyone think of a situation in which this would
    > represent an unsafe operation?  I've been trying to think of a value for
    > x for which this expression could have side effects, but I haven't come
    > up with anything yet, and I suspect I won't.
    >

    Yes.  toliteral() may induce a (small) rounding error when used on
    floating-point numbers.

    	-hpa
    --
    PGP public key available - finger hpa@zytor.com
    "The earth is but one country, and mankind its citizens."  --  Bahá'u'lláh
    Just Say No to Morden * Save Babylon 5: http://www.babylon5.com/cmp/support/
    The cat is out of the bag - Linux 2.0 is available!

References:

- eval / toliteral safety question

- From: "Seth I. Rich" <sir@po.cwru.edu>

- Prev: Re: eval / toliteral safety question
- Next: Re: eval / toliteral safety question
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index