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