fixsfdi.c (82725ba9bf1fd59746a4006a06f24d4d61d142f2) fixsfdi.c (feb1d5507e4730fe401e6ae28a56579b814519ef)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1992 The Regents of the University of California.
5 * 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

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

46 * We clamp anything that is out of range.
47 *
48 * N.B.: must use new ANSI syntax (sorry).
49 */
50long long
51__fixsfdi(float x)
52{
53 if (x < 0)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1992 The Regents of the University of California.
5 * 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

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

46 * We clamp anything that is out of range.
47 *
48 * N.B.: must use new ANSI syntax (sorry).
49 */
50long long
51__fixsfdi(float x)
52{
53 if (x < 0)
54 if (x <= QUAD_MIN)
54 if (x <= (float)QUAD_MIN)
55 return (QUAD_MIN);
56 else
57 return ((quad_t)-(u_quad_t)-x);
58 else
55 return (QUAD_MIN);
56 else
57 return ((quad_t)-(u_quad_t)-x);
58 else
59 if (x >= QUAD_MAX)
59 if (x >= (float)QUAD_MAX)
60 return (QUAD_MAX);
61 else
62 return ((quad_t)(u_quad_t)x);
63}
60 return (QUAD_MAX);
61 else
62 return ((quad_t)(u_quad_t)x);
63}