lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Nov 2008 18:50:21 -0500
From:	"Jochen Voß" <jochen.voss@...glemail.com>
To:	"Andrew Morton" <akpm@...ux-foundation.org>
Cc:	"Trent Piepho" <tpiepho@...escale.com>, djwong@...ibm.com,
	khali@...ux-fr.org, linux-kernel@...r.kernel.org,
	lm-sensors@...sensors.org
Subject: Re: [lm-sensors] [PATCH 1/2] Create a DIV_ROUND_CLOSEST macro to do division with rounding

Hi,

2008/11/11 Andrew Morton <akpm@...ux-foundation.org>:
> yup.  I wonder why the compiler doesn't do that for itself - is there a
> case where it will generate a different result?

The test program

    #include <stdio.h>
    int
    main()
    {
        signed int x = -1;
        printf("%d %d\n", x/2, x>>1);
        return 0;
    }

says

    0 -1

so it seems to make a difference.

All the best,
Jochen
-- 
http://seehuhn.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ