Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 1999 17:09:54 -0500 (EST)
From:      twp@rootsweb.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/10863: rint(3) returns erratic results
Message-ID:  <199903292209.RAA11713@ma-1.rootsweb.com>

next in thread | raw e-mail | index | archive | help

>Number:         10863
>Category:       bin
>Synopsis:       rint(3) returns erratic results
>Confidential:   yes
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 29 14:20:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Tim Pierce
>Release:        FreeBSD 2.2.7-RELEASE i386
>Organization:
RootsWeb Genealogical Data Cooperative
>Environment:

	

>Description:

rint(3) appears to return inconsistent results for some inputs.  For
example, it rounds both 5.5 and 6.5 to 6.  If rint always rounds up,
it should round these numbers to 6 and 7; if it always rounds down, it
should round these numbers to 5 and 6; if it always rounds to the
nearest integer, it should round to 6 and 7.  Is there any situation
where it would be correct to round both 5.5 and 6.5 to 6?

>How-To-Repeat:

#include <math.h>

main()
{
    printf ("%f\n", rint(5.5));
    printf ("%f\n", rint(6.5));
}

>Fix:
	
	



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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