home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1018 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!wupost!sdd.hp.com!mips!msi!snoopy!bill
  3. From: bill@snoopy (Bill Poitras)
  4. Subject: Re: bug in expr?
  5. Message-ID: <1992Jul22.000400.13694@msi.com>
  6. Sender: usenet@msi.com (USENET)
  7. Reply-To: bill@msi.com
  8. Organization: Molecular Simulations, Inc.
  9. X-Newsreader: Tin 1.1 PL4
  10. References: <1992Jul21.215415.23716@crd.ge.com>
  11. Date: Wed, 22 Jul 1992 00:04:00 GMT
  12. Lines: 22
  13.  
  14. kennykb@dssv01.crd.ge.com (Kevin B. Kenny) writes:
  15. : Can someone explain the following?  More to the point, can someone fix it?
  16. : wish: set x [expr 400000.0+500000.0]
  17. : 900000
  18. : wish: set y [expr $x*$x]
  19. : -1748818944
  20. : The square of 900000.0 oughtn't to be a large negative number.
  21.  
  22. What should it be?  Overflow?  It helps to specify what you want.  In tcl
  23. as it is, creating a result larger than 2^32 is undefined.  What do you
  24. want it defined as?
  25.  
  26. --
  27. +-----------------+-------------------------------+-------------------------+
  28. | Bill Poitras    | Molecular Simulations Inc.    | Tel (408)522-9229       |
  29. | (bill)          | Sunnyvale, CA USA             |                         | 
  30. |                 | FAX (408)732-0831             | bill@msi.com            |
  31. +-----------------+-------------------------------+-------------------------+
  32.  
  33.