Article View: borland.public.jbuilder.java.language
Article #7381Re: Newbie Truncate question
From: dnoyeB
Date: Sun, 24 Jun 2001 15:34
Date: Sun, 24 Jun 2001 15:34
46 lines
2674 bytes
2674 bytes
That is utter stupidity. Is it so hard for them to say "truncate." See the confusion they have caused. Geez. The spec reads like a stupid legal document. I never read the spec, its just a headache. I tried to understand 1 thing from the spec once, and I read it over and over for hours to no avail. Best to just test it. WIsh they would use some common sense and language when creating these documents... "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.159f70098c2c2fe498a2d7@forums.borland.com... > On Sat, 23 Jun 2001 12:15:36 -0400, "CLG" <lamont_gilbert @ > rigidsoftware.com> wrote: > > > Since when does casting round?? > > The Java Language Specification uses the terminology from the IEEE 754 > floating point spec. Java uses "round toward zero" as opposed to > "round to nearest". What it calls "round toward zero" is often > referred to as truncation. > > From JLS section 5.1.3: > > ... the floating-point value is rounded to an integer value V, > rounding toward zero using IEEE 754 round-toward-zero mode > (�4.2.3). > > And section 4.2.3 says: > > The language uses round toward zero when converting a floating > value to an integer (�5.1.3), which acts, in this case, as though > the number were truncated, discarding the mantissa bits. Rounding > toward zero chooses at its result the format's value closest to > and no greater in magnitude than the infinitely precise result. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3b376e41_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b2f52a0_1@dnews> <3b327232$1_2@dnews> <3b32fc72$1_1@dnews> <3b34c1a3$1_2@dnews> <MPG.159f70098c2c2fe498a2d7@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,568d12e56ba0c6bd X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-25 10:12:16 PST From: "dnoyeB" <lamont_gilbert @ rigidsoftware.com> Newsgroups: borland.public.jbuilder.java.language References: <3b2f52a0_1@dnews> <3b327232$1_2@dnews> <3b32fc72$1_1@dnews> <3b34c1a3$1_2@dnews> <MPG.159f70098c2c2fe498a2d7@forums.borland.com> Subject: Re: Newbie Truncate question Date: Sun, 24 Jun 2001 11:34:31 -0400 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 63.68.196.49 Message-ID: <3b376e41_1@dnews> X-Trace: dnews 993488449 63.68.196.49 (25 Jun 2001 10:00:49 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews