[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#430126: marked as done (why: caduceus: the abs example is in fact wrong)



Your message dated Mon, 16 Jan 2012 19:12:36 +0100
with message-id <20120116181236.GA11216@dogguy.org>
and subject line Re: Bug#430126: why: caduceus: the abs example is in fact wrong
has caused the Debian Bug report #430126,
regarding why: caduceus: the abs example is in fact wrong
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
430126: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=430126
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: why
Version: 2.03.dfsg-1
Severity: normal

Hello,

the "abs" example, which is bundled with caduceus, is not really correct.

What's the problem:

/* @ensures \result > 0 */
int abs(int x) { return x<0 ? -x : x; }

This number work for all integers, except for one. In the base-2 complement,
there are two numbers which staisfy x==-x. One is 0, and the other is
0x80000000 hex (on 32 bit architecture), which is negative. therefore,
abs(this number) is negative.

Regards
   Jiri Palecek

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.20.3-rt8 (PREEMPT)
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2) (ignored: LC_ALL set to cs_CZ)
Shell: /bin/sh linked to /bin/dash

Versions of packages why depends on:
ii  libatk1.0-0                   1.18.0-2   The ATK accessibility toolkit
ii libc6 2.5-11 GNU C Library: Shared libraries ii libcairo2 1.4.6-1.1 The Cairo 2D vector graphics libra ii libfontconfig1 2.4.2-1.2 generic font configuration library
ii  libglib2.0-0                  2.12.12-1  The GLib library of C routines
ii libgtk2.0-0 2.10.13-1 The GTK+ graphical user interface ii libpango1.0-0 1.16.4-1 Layout and rendering of internatio
ii  libx11-6                      2:1.0.3-7  X11 client-side library
ii  libxcursor1                   1:1.1.8-2  X cursor management library
ii libxext6 1:1.0.3-2 X11 miscellaneous extension librar ii libxfixes3 1:4.0.3-2 X11 miscellaneous 'fixes' extensio
ii  libxi6                        1:1.0.1-4  X11 Input extension library
ii  libxinerama1                  1:1.0.2-1  X11 Xinerama extension library
ii  libxrandr2                    2:1.2.1-1  X11 RandR extension library
ii libxrender1 1:0.9.2-1 X Rendering Extension client libra

why recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
Version: 2.04.dfsg-1

Jiří Paleček <jpalecek@web.de> wrote:
> Package: why
> Version: 2.03.dfsg-1
> Severity: normal
> 
> Hello,
> 
> the "abs" example, which is bundled with caduceus, is not really correct.
> 
> What's the problem:
> 
> /* @ensures \result > 0 */
> int abs(int x) { return x<0 ? -x : x; }
> 
> This number work for all integers, except for one. In the base-2
> complement,
> there are two numbers which staisfy x==-x. One is 0, and the other is
> 0x80000000 hex (on 32 bit architecture), which is negative. therefore,
> abs(this number) is negative.
> 

I think that this is fixed since quite some time now. Closing...

Regards,

-- 
Mehdi Dogguy


--- End Message ---

Reply to: