Sourceware Bugzilla – Attachment 8089 Details for
Bug 17899
[powerpc] floorl returns negative zero with FE_DOWNWARD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
floorl test case.
floorl.c (text/plain), 986 bytes, created by
Martin Sebor
on 2015-01-29 03:38:22 UTC
(
hide
)
Description:
floorl test case.
Filename:
MIME Type:
Creator:
Martin Sebor
Created:
2015-01-29 03:38:22 UTC
Size:
986 bytes
patch
obsolete
>#include <fenv.h> >#include <math.h> >#include <stdio.h> > >void print_raw (const void *f, size_t n) { > typedef unsigned char UChar; > const UChar *pb; > for (pb = (UChar*)f; pb != (UChar*)f + n; ++pb) > printf ("%02x ", *pb); >} > >#define print_raw(x) print_raw(&x, sizeof x) > >#define check(a, X, Y) do { \ > __typeof__ (Y) x = X; \ > __typeof__ (Y) y = Y; \ > fesetround (FE_DOWNWARD); \ > printf ("%-20s = { ", a); \ > print_raw (x); \ > printf ("}\n%-20s = { ", "expected"); \ > print_raw (y); \ > printf ("}\n"); \ > if (signbit (x) != signbit (y)) \ > printf ("failure: sign mismatch\n"); \ > } while (0) > >int main () { >#define CHECK(f, y) check (#f, f, y) > > CHECK (floorf (0.1f), 0.0f); > CHECK (floor (0.1), 0.0); > CHECK (floorl (0.1L), 0.0L); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 17899
: 8089