🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7414

Re: Newbie Truncate question

#7414
From: dnoyeB
Date: Wed, 20 Jun 2001 21:18
22 lines
1313 bytes
Take the low road...
double z = 1.02;
int x = (int)z;


not more complicated than that.
you could use
int x = (int)Double.doubleToLongBits(z);

but i suspect it does exactly the same thing.


"Phil Barber" <barber@galtney.com> wrote in message news:3b2f52a0_1@dnews...
> How do I truncate a double
> (in delphi:  integer := trunc(double);)
> in Java???
>
> thanks
> Phil.
>
>
>
Technical Details
Message-ID: <3b327232$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews
References: <3b2f52a0_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,568d12e56ba0c6bd
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-21 15:36:26 PST
From: "dnoyeB" <lamont_gilbert @ rigidsoftware.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b2f52a0_1@dnews>
Subject: Re: Newbie Truncate question
Date: Wed, 20 Jun 2001 17:18:07 -0400
Lines: 24
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: <3b327232$1_2@dnews>
X-Trace: dnews 993161778 63.68.196.49 (21 Jun 2001 15:16:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews