Subject: lib/4147: rintf() (3) returns incorrect values
To: None <>
From: Per Amund Amundsen <>
List: netbsd-bugs
Date: 09/24/1997 13:22:17
>Number:         4147
>Category:       lib
>Synopsis:       rintf() (3) returns incorrect values
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 24 04:35:00 1997
>Originator:     Per Amund Amundsen
Per Amund Amundsen                 
School of Science and Technology
Stavanger College, PO Box 2557 Ullandhaug    Tlf: (+47) 51 83 18 77
N-4004 Stavanger, Norway		     Fax: (+47) 51 83 17 50
>Release:        1.2.1
	System: NetBSD 1.2.1 NetBSD 1.2.1 (BSD-AMUNDSEN)
	#7: Thu Sep 18 14:16:28 MET DST 1997

	The rintf() (3) math library function (float version of
	rint()) returns a nearby multiple of 0.125, although not
	necessarily the closest.

	Really an optimizer bug - quite possibly restricted to i386.

	Compile and link the following prograam, and watch it print

	#include <stdio.h>
	#include <math.h>
	int main() {printf("%f\n",rintf(1.05));  return 0;}

	Work-around: Compile ../src/lib/libm/src/s_rintf.c 
	from the -current distribution *without optimization*, and link
	with it.