🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #70

Re: Floating point equal to Integer Value ?

#70
From: Michael Rubenstein
Date: Wed, 11 Jul 2001 11:56
14 lines
1826 bytes
On 11 Jul 2001 00:37:31 -0700, san_2820@yahoo.com (Sanjay kumar)
wrote:

>Hi I think it would be no problem if you convert float to integer
>instead of interger to float just for comparision purpose
>
>instead of (float(x) == y) 
>to (x == (int) y)
>
>this will never fail.

What will happen if y is too large to fit in an int?
-- 
Michael M Rubenstein
Technical Details
Message-ID: <3nfoktcaq7u8iko4rhq437rb87vbgee8ku@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail
References: <9iejot$4an2@news.emirates.net.ae> <9cb96ed6.0107102337.c746ba9@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108b44,dbd8a1f951d6b446
X-Google-Attributes: gid108b44,public
X-Google-Thread: 109fba,dbd8a1f951d6b446
X-Google-Attributes: gid109fba,public
X-Google-Thread: 114592,dbd8a1f951d6b446
X-Google-Attributes: gid114592,public
X-Google-Thread: 10d4ba,dbd8a1f951d6b446
X-Google-Attributes: gid10d4ba,public
X-Google-Thread: 108717,dbd8a1f951d6b446
X-Google-Attributes: gid108717,public
X-Google-Thread: 10b1c0,dbd8a1f951d6b446
X-Google-Attributes: gid10b1c0,public
X-Google-ArrivalTime: 2001-07-11 04:57:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail
From: Michael Rubenstein <mike@mrubenstein.com>
Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++,comp.programming,comp.sys.lang.c++,csugrad.programming.c
Subject: Re: Floating point equal to Integer Value ?
Date: Wed, 11 Jul 2001 07:56:46 -0400
Lines: 14
Message-ID: <3nfoktcaq7u8iko4rhq437rb87vbgee8ku@4ax.com>
References: <9iejot$4an2@news.emirates.net.ae> <9cb96ed6.0107102337.c746ba9@posting.google.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: UmFuZG9tSVZkQa/cJ78rutQaVfMtCGkcCyVx5NGn2I7H99ZYsk9dFDehjhigjC/vQONzDXhsyN4=
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 11 Jul 2001 11:56:46 GMT
X-Newsreader:  Forte Agent 1.8/32.548