amd64/156464: fpsetprec does not work

Michirou & yabuki at fuchan.myaw.ei.meisei-u.ac.jp
Mon Apr 18 08:30:12 UTC 2011


>Number:         156464
>Category:       amd64
>Synopsis:       fpsetprec does not work
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-amd64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 18 08:30:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Michirou Yabuki
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD nm64 8.2-RELEASE FreeBSD GENERIC


	

amd64,  FreeBSD 8.2-RELEASE GENERIC
fpsetprec(), fpgetprec()

>Description:

	

In default, fpgetprec() returns FP_PE, but results show FP_PD.
if fpsetprec(FP_PE) is called, results are never changed.

This is not happen on FreeBSD8.2-RELEASE i386 version.


>How-To-Repeat:

#include <stdio.h>
#include <stdlib.h>
#include <machine/ieeefp.h>
int main()
{
    double a, b, c, d;

    printf("fpgetprec %d\n",   fpgetprec()); // 3 on amd64, 2 on i386

    a = 10.0;
    b = 2.718281810;
    c = a / (b * b);
    printf("%20.16e\n",   c);  // 1.3533528507465618e+00 on both

    fpsetprec(FP_PE);
    a = 10.0;
    b = 2.718281810;
    c = a / (b * b);
    printf("%20.16e\n",   c);
              // 1.3533528507465618e+00 on amd64
	      // 1.3533528507465620e+00 on i386

    exit(0);
}



>Fix:

	I don't know.

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


More information about the freebsd-amd64 mailing list