FYI: Don't trust (read <entity handle>)

Discussion in 'AutoCAD' started by James Allen, Feb 10, 2005.

  1. James Allen

    James Allen Guest

    I was working on something that uses the handle as a key (in the form of a
    symbol) and discovered this. You may encounter something like
    "error: bad argument type: symbolp 1.#INF".
    In this case the entity handle was "1E639". Well, (read "1E639") yields
    1.#INF ! Type in 1e34, and then 1e639 if it still doesn't make sense.
    1e639 is not a valid symbol because it is in the form of a number, even
    though it is way beyond the valid numeric range.

    So prefix your entity handles with some string before expecting them to read
    to a symbol. :\ (BTW, I mainly posted this so that the next person like me
    that google searches for "1.#INF" might get more than two useful hits!)
    Well, that was fun. ;)
     
    James Allen, Feb 10, 2005
    #1
  2. James Allen

    BillZ Guest

    Command: (read "1E308")
    1.0e+308

    Command: (read "1E309")
    1.#INF

    Must be the cut off for an infinite number?

    Hmmm...


    Bill
     
    BillZ, Feb 10, 2005
    #2
  3. James Allen

    BillZ Guest

    Command: (read "1E-323")
    9.88131e-324

    Command: (read "1E-324")
    0.0

    Command: (read "1E-325")
    0.0

    Interesting.
     
    BillZ, Feb 10, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.