home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1033 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.7 KB

  1. Path: sparky!uunet!sun-barr!ames!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: bug in expr?
  5. Date: 22 Jul 1992 22:56:20 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 45
  8. Distribution: world
  9. Message-ID: <14kp2kINNfpo@agate.berkeley.edu>
  10. References: <1992Jul21.215415.23716@crd.ge.com> <1992Jul22.163913.27329@cbnewsm.cb.att.com> <1992Jul22.215800.25832@crd.ge.com>
  11. NNTP-Posting-Host: tyranny.berkeley.edu
  12.  
  13. In article <1992Jul22.215800.25832@crd.ge.com>, kennykb@dssv01.crd.ge.com (Kevin B. Kenny) writes:
  14. |> 
  15. |> In article <1992Jul22.163913.27329@cbnewsm.cb.att.com>, gah@grenache (George A.
  16. |> Howlett) writes:
  17. |> |> I think the point that Kevin is making is that if you started out
  18. |> |> with floating point values, you should get a floating point result.
  19. |> |> The implicit demotion of the sum of two floating point numbers into
  20. |> |> a integer result is unexpected.  It's fairly easy to detect here,
  21. |> |> but insidiously hard to track in more complex usages. 
  22. |> 
  23. |> Yes indeed.  That was the point.  Sorry I hadn't made myself clearer
  24. |> -- I'd just been at my terminal for several hours tracking down a
  25. |> particularly insidious bug that resulted from the implicit demotion.
  26. |> 
  27. |> The %#g idea is a good one -- I'd forgotten about the `#' flag, also!
  28. |> (time to dust off Harbison and Steele...).  The OFMT variable might be
  29. |> even better.  John, do you have any comments?
  30. |> 
  31.  
  32. This sounds like a good idea.  I almost implemented it on the spot, but
  33. then I got worried about potential compatibility problems, since it
  34. won't behave quite the same as the current approach.  Right now I think
  35. I better wait till a more "controlled" time to do this (see below).
  36.  
  37. |> 
  38. |> Thanks, George -- I appear to have missed it.
  39. |> 
  40. |> |> BTW: If you are using the patch to add math library functions,
  41. |> |>      you could have explicitly promoted x using the "float()"
  42. |> |>      function.
  43. |> 
  44. |> Gosh, it's time to take another look at *that* patch, too.  I've been
  45. |> mening to install it.  John, can we get that one into the standard
  46. |> product?  It's needed.
  47. |> 
  48.  
  49. Yes, it's absolutely needed.  I've been putting off all non-trivial changes to
  50. Tcl until I get text widgets done for Tk.  At some point soon I plan to make
  51. a major pass over Tcl to catch up on a bunch of features like this that
  52. have needed implementing for a long time.  Some of them, like the "%#g"
  53. change, might cause tiny incompatibilities.  My plan is to post all the
  54. potential incompatibilties to the newsgroup for comments, then implement all
  55. the ones that don't get too many complaints and bump Tcl's version number
  56. to 7.0.  Sorry that Tcl's been getting neglected for the last year, but I
  57. was afraid that Tk would never get finished otherwise.
  58.