delorie.com/archives/browse.cgi | search |
From: | "Lars O. Hansen" <lars DOT o DOT hansen AT gmx DOT de> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: C preprocessor not capable of floating point division ? |
Date: | Sat, 21 Dec 2002 05:52:12 +0100 |
Organization: | 1&1 Internet AG |
Lines: | 15 |
Message-ID: | <au0s1n$hqn$1@news.online.de> |
References: | <au0qd9$hkj$1 AT news DOT online DOT de> <Xns92EAF18D1776Casu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> |
NNTP-Posting-Host: | p5083854e.dip0.t-ipconnect.de |
X-Trace: | news.online.de 1040446327 18263 80.131.133.78 (21 Dec 2002 04:52:07 GMT) |
X-Complaints-To: | abuse AT online DOT de |
NNTP-Posting-Date: | 21 Dec 2002 04:52:07 GMT |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 6.00.2800.1106 |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2800.1106 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
> how do you propose to store 0.5 in an integer? > > > How can I achieve floating point division or similar having the same > > result by the C preprocessor for #define d values ? > > you'll have to clarify what you are trying to do. it should have been float a=2/sth. But DJ Delorie is right, the preprocessor or compiler which does expression evaluation beforehand "obeyes" the rules of x86 "integer division", so 4/8 is 0.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |