🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #4135

Re: Rounding off a double precision variable

#4135
From: Thomas Krog Christensen
Date: Thu, 23 Mar 2000 00:00
12 lines
1686 bytes
> Is this compiler dependent?  Don't C++ programs truncate when converting
> from double to int?

Yes they do. But if you want to truncate from double to double I think it's
faster to use floor.(if not there won't be any reason to use floor)


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]
Technical Details
Message-ID: <8bbpqf$rhi$1@nevald.k-net.dk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <C5Ns4.5456$kz6.102045@news1.online.no> <8913h0$o97$1@eising.k-net.dk> <38D776C8.6DF0D493@ix.netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d22,e2bc0eb4b79bfbd0
X-Google-Attributes: gid109d22,public
X-Google-Thread: f78e5,e2bc0eb4b79bfbd0
X-Google-Attributes: gidf78e5,public
From: "Thomas Krog Christensen" <rick@kampsax.dtu.dk>
Subject: Re: Rounding off a double precision variable
Date: 2000/03/23
Message-ID: <8bbpqf$rhi$1@nevald.k-net.dk>
X-Deja-AN: 601098470
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <C5Ns4.5456$kz6.102045@news1.online.no> <8913h0$o97$1@eising.k-net.dk> <38D776C8.6DF0D493@ix.netcom.com>
X-Priority: 3
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 953772918 mail2news:16150 mail2news mail2news.demon.co.uk
Organization: K-Net
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MSMail-Priority: Normal
NNTP-Posting-Date: 23 Mar 2000 00:51:27 GMT
Newsgroups: comp.std.c++,dk.edb.programmering.c