test-fma.c (177876) | test-fma.c (216222) |
---|---|
1/*- 2 * Copyright (c) 2008 David Schultz <das@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Tests for fma{,f,l}(). 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 David Schultz <das@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Tests for fma{,f,l}(). 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/tools/regression/lib/msun/test-fma.c 177876 2008-04-03 06:15:58Z das $"); | 32__FBSDID("$FreeBSD: head/tools/regression/lib/msun/test-fma.c 216222 2010-12-06 00:02:49Z das $"); |
33 34#include <assert.h> 35#include <fenv.h> 36#include <float.h> 37#include <math.h> 38#include <stdio.h> 39 40#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ --- 39 unchanged lines hidden (view full) --- 80 * Determine whether x and y are equal, with two special rules: 81 * +0.0 != -0.0 82 * NaN == NaN 83 */ 84int 85fpequal(long double x, long double y) 86{ 87 | 33 34#include <assert.h> 35#include <fenv.h> 36#include <float.h> 37#include <math.h> 38#include <stdio.h> 39 40#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ --- 39 unchanged lines hidden (view full) --- 80 * Determine whether x and y are equal, with two special rules: 81 * +0.0 != -0.0 82 * NaN == NaN 83 */ 84int 85fpequal(long double x, long double y) 86{ 87 |
88 return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y))); | 88 return ((x == y && !signbit(x) == !signbit(y)) 89 || (isnan(x) && isnan(y))); |
89} 90 91static void 92test_zeroes(void) 93{ 94 const int rd = (fegetround() == FE_DOWNWARD); 95 96 testall(0.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); --- 317 unchanged lines hidden --- | 90} 91 92static void 93test_zeroes(void) 94{ 95 const int rd = (fegetround() == FE_DOWNWARD); 96 97 testall(0.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); --- 317 unchanged lines hidden --- |