Subject: lib/7829: Infinity incorrect (arm32)
To: None <gnats-bugs@gnats.netbsd.org>
From: Richard Earnshaw <rearnsha@cambridge.arm.com>
List: netbsd-bugs
Date: 06/21/1999 12:23:49
>Number:         7829
>Category:       lib
>Synopsis:       Infinity incorrect (arm32)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 21 12:05:01 1999
>Last-Modified:
>Originator:     Richard Earnshaw
>Organization:
ARM
-- 
>Release:        NetBSD-current or earlier<NetBSD-current source date>
>Environment:
	
System: NetBSD shark1 1.4D NetBSD 1.4D (SHARK) #40: Fri Jun 18 17:14:00 BST 1999 rearnsha@shark1:/usr/src/sys/arch/arm32/compile/SHARK arm32


>Description:
	The arm32 setting of infinity is incorrect, causing HUGE_VAL to be not
	very huge at all :-(

	
>How-To-Repeat:

	Compile and run the following program, it should print "Inf, Inf",
	but doesn't.

	#include <math.h>
	union{int x[2]; double d;} p;

	main()
	{
	  p.x[0] = 0x7ff00000;
	  p.x[1] = 0;
	
	  printf("%f, %f\n", HUGE_VAL, p.d);
	}

	
>Fix:

	Correct setting (in lib/libc/arch/arm32/gen/infinity.c) should be

	const char __infinity[] = { 0, 0, (char)0xf0, 0x7f, 0, 0, 0, 0 };

	
	
>Audit-Trail:
>Unformatted: