Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jun 2003 08:51:31 -0300
From:      "Daniel C. Sobral" <dcs@tcoip.com.br>
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Message buffer and printf reentrancy patch
Message-ID:  <3EF83B43.3000100@tcoip.com.br>
In-Reply-To: <20030615190209.GA75458@falcon.midgard.homeip.net>
References:  <200306151406.aa36218@salmon.maths.tcd.ie> <200306151826.h5FIPvM7046944@gw.catspoiler.org> <20030615190209.GA75458@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Erik Trulsson wrote:
> 
> With a C99 compiler it is always true.  In C89 it was implementation
> defined if integer division rounded towards zero or towards
> negative-infinity.  In C99 integer division always rounds towards zero.
> This combined with the fact that (a/b)*b + a%b == a is always true (for
> integer a,b and b!=0) means that (neg_int % pos_int <= 0 ) is always
> true in C99, while it wasn't always true in C89.

Heh. I recall when ANS Forth was being discussed that people found it 
silly all the discussion around whether signed integer division was 
symmetric or floored, when even C didn't bother with it. :-)

(And, if you are interested in such things, the problem was that 
Forth-79 was symmetric, Forth-83 was floored (or vice versa -- I don't 
know); the solution was to leave / as implementation defined and 
creating two new operators: one symmetric and one floored. :)

-- 
Daniel C. Sobral                   (8-DCS)
Gerencia de Operacoes
Divisao de Comunicacao de Dados
Coordenacao de Seguranca
VIVO Centro Oeste Norte
Fones: 55-61-313-7654/Cel: 55-61-9618-0904
E-mail: Daniel.Capo@tco.net.br
         Daniel.Sobral@tcoip.com.br
         dcs@tcoip.com.br

Outros:
	dcs@newsguy.com
	dcs@freebsd.org
	capo@notorious.bsdconspiracy.net

I finally got it all together ...
but I forgot where I put it.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EF83B43.3000100>