Date: Sat, 23 Dec 2006 07:54:11 GMT From: Jim White<crewman6@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: sparc64/107130: conversion from long double to long giving incorrect values Message-ID: <200612230754.kBN7sB5e085380@www.freebsd.org> Resent-Message-ID: <200612230800.kBN80USj032065@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 107130 >Category: sparc64 >Synopsis: conversion from long double to long giving incorrect values >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-sparc64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 23 08:00:30 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jim White >Release: 6.1-RELEASE >Organization: >Environment: FreeBSD ultra.lan 6.1-RELEASE FreeBSD 6.1-RELEASE #1: Mon Oct 9 03:58:10 UTC2006 root@ultra.lan:/usr/src/sys/sparc64/compile/SPARC64-JKW sparc64 (GENERIC kernel with ROOTDEVNAME set) >Description: Conversions from long double to long and long long where the long double is a negative number always result in a value -1. This seems related to closed PR 55773, >How-To-Repeat: #include <stdio.h> int main() { long double i; for (i=0;;i=i-1.0) printf("%Lf %d %ld %lld %f\n",i,(int)i,(long)i,(long long)i,(double)i); return 0; } Sample Output: 0.000000 0 0 0 0.000000 -1.000000 -1 -1 -1 -1.000000 -2.000000 -2 -1 -1 -2.000000 -3.000000 -3 -1 -1 -3.000000 -4.000000 -4 -1 -1 -4.000000 -5.000000 -5 -1 -1 -5.000000 -6.000000 -6 -1 -1 -6.000000 -7.000000 -7 -1 -1 -7.000000 -8.000000 -8 -1 -1 -8.000000 -9.000000 -9 -1 -1 -9.000000 -10.000000 -10 -1 -1 -10.000000 >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612230754.kBN7sB5e085380>