Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2011 16:52:30 +0900 (JST)
From:      Michirou & <yabuki@fuchan.myaw.ei.meisei-u.ac.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   amd64/156464: fpsetprec does not work
Message-ID:  <201104180752.p3I7qUrs047529@fuchan.myaw.ei.meisei-u.ac.jp>
Resent-Message-ID: <201104180830.p3I8UBVF071336@freefall.freebsd.org>

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

>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:



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