fixdfdi.c (c6879c6c14eedbd060ba588a3129a6c60ebbe783) fixdfdi.c (feb1d5507e4730fe401e6ae28a56579b814519ef)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and

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

44/*
45 * Convert double to (signed) quad.
46 * We clamp anything that is out of range.
47 */
48quad_t
49__fixdfdi(double x)
50{
51 if (x < 0)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and

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

44/*
45 * Convert double to (signed) quad.
46 * We clamp anything that is out of range.
47 */
48quad_t
49__fixdfdi(double x)
50{
51 if (x < 0)
52 if (x <= QUAD_MIN)
52 if (x <= (double)QUAD_MIN)
53 return (QUAD_MIN);
54 else
55 return ((quad_t)-(u_quad_t)-x);
56 else
53 return (QUAD_MIN);
54 else
55 return ((quad_t)-(u_quad_t)-x);
56 else
57 if (x >= QUAD_MAX)
57 if (x >= (double)QUAD_MAX)
58 return (QUAD_MAX);
59 else
60 return ((quad_t)(u_quad_t)x);
61}
58 return (QUAD_MAX);
59 else
60 return ((quad_t)(u_quad_t)x);
61}