delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/04/22/13:45:03

Message-ID: <3EA57D64.4030000@cyberoptics.com>
Date: Tue, 22 Apr 2003 12:35:32 -0500
From: Eric Rudd <rudd AT cyberoptics DOT com>
Organization: CyberOptics
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en,pdf
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
CC: djgpp-workers AT delorie DOT com
Subject: Re: Bug 00314 -- div() still broken
References: <fA9pa.20115$1s1 DOT 299825 AT newsfeeds DOT bigpond DOT com> <dsbaavskl0dei9epnr9t4qnu2nn16d96sj AT 4ax DOT com> <3EA54F78 DOT C46438ED AT phekda DOT freeserve DOT co DOT uk> <3EA57418 DOT 2060506 AT cyberoptics DOT com> <3EA5789C DOT F1E0CFBB AT phekda DOT freeserve DOT co DOT uk>
In-Reply-To: <3EA5789C.F1E0CFBB@phekda.freeserve.co.uk>
Lines: 18
NNTP-Posting-Host: 65.214.98.62
X-Trace: 1051032912 1243 65.214.98.62
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Richard Dawe wrote:

>I thought maybe someone knew something I didn't. Like: perhaps this code gives
>the correct behaviour with long long, but smaller types don't need it?
>
According to C99:

   7.20.6.2  The div, ldiv, and lldiv functions

   [#2]  The  div,  ldiv,  and lldiv, functions compute numer /
   denom and numer % denom in a single operation.

so if special tests were needed for lldiv, then there would be something 
wrong with / or % for long longs, which would need to be fixed instead.

-Eric Rudd
rudd AT cyberoptics DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019