Re: Message buffer and printf reentrancy patch

From: Daniel C. Sobral (dcs_at_tcoip.com.br)
Date: 06/24/03

  • Next message: Pawel Jakub Dawidek: "Jailed sysvipc implementation."
    Date: Tue, 24 Jun 2003 08:51:31 -0300
    To: Erik Trulsson <ertr1013@student.uu.se>
    
    

    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.
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Pawel Jakub Dawidek: "Jailed sysvipc implementation."

    Relevant Pages

    • Re: overload builtin operator
      ... ZeroDivisionError: integer division or modulo by zero ...
      (comp.lang.python)
    • Re: Conditional iteration
      ... ZeroDivisionError: integer division or modulo by zero ...
      (comp.lang.python)
    • Re: Twos complement integer divided by Powers of 2 question
      ... When a signed positive integer X divided by pow, the result is shifting k bits to right and putting w-k bits of 0 from the most significant bits. ... However, the result of the integer division -3/2 is not -2, but -1: Integer division discards the fractional part of the "true" quotient, ... For even X there's nothing to truncate and you'll get the same answer either way, and for positive X zero is in the same direction as minus infinity. ...
      (comp.lang.c)
    • Re: Conditional iteration
      ... ZeroDivisionError: integer division or modulo by zero ...
      (comp.lang.python)
    • Re: Why is there div() in the standard lib
      ... support integers?] ... I recall Fortran allowing only two kinds of integer division: ... Reading email is like searching for food in the garbage, ...
      (comp.lang.c)