Deleted Added
full compact
test-trig.c (176748) test-trig.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

--- 20 unchanged lines hidden (view full) ---

29 * are included as well, but these are very basic sanity checks, not
30 * intended to be comprehensive.
31 *
32 * The program for generating representable numbers near multiples of pi is
33 * available at http://www.cs.berkeley.edu/~wkahan/testpi/ .
34 */
35
36#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

--- 20 unchanged lines hidden (view full) ---

29 * are included as well, but these are very basic sanity checks, not
30 * intended to be comprehensive.
31 *
32 * The program for generating representable numbers near multiples of pi is
33 * available at http://www.cs.berkeley.edu/~wkahan/testpi/ .
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/tools/regression/lib/msun/test-trig.c 176748 2008-03-02 20:49:24Z das $");
37__FBSDID("$FreeBSD: head/tools/regression/lib/msun/test-trig.c 216222 2010-12-06 00:02:49Z das $");
38
39#include <assert.h>
40#include <fenv.h>
41#include <float.h>
42#include <math.h>
43#include <stdio.h>
44
45#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \

--- 39 unchanged lines hidden (view full) ---

85/*
86 * Determine whether x and y are equal, with two special rules:
87 * +0.0 != -0.0
88 * NaN == NaN
89 */
90int
91fpequal(long double x, long double y)
92{
38
39#include <assert.h>
40#include <fenv.h>
41#include <float.h>
42#include <math.h>
43#include <stdio.h>
44
45#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \

--- 39 unchanged lines hidden (view full) ---

85/*
86 * Determine whether x and y are equal, with two special rules:
87 * +0.0 != -0.0
88 * NaN == NaN
89 */
90int
91fpequal(long double x, long double y)
92{
93 return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
93 return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
94}
95
96/*
97 * Test special cases in sin(), cos(), and tan().
98 */
99static void
100run_special_tests(void)
101{

--- 193 unchanged lines hidden ---
94}
95
96/*
97 * Test special cases in sin(), cos(), and tan().
98 */
99static void
100run_special_tests(void)
101{

--- 193 unchanged lines hidden ---