10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 #if defined(ELFOBJ)
31 #pragma weak frexp = __frexp
32 #endif
33
34 /*
35 * frexp(x, exp) returns the normalized significand of x and sets
36 * *exp so that x = r*2^(*exp) where r is the return value. If x
37 * is finite and nonzero, 1/2 <= |r| < 1.
38 *
39 * If x is zero, infinite or NaN, frexp returns x and sets *exp = 0.
40 * (The relevant standards do not specify *exp when x is infinite or
41 * NaN, but this code sets it anyway.)
42 *
43 * If x is a signaling NaN, this code returns x without attempting
44 * to raise the invalid operation exception. If x is subnormal,
45 * this code treats it as nonzero regardless of nonstandard mode.
46 */
47
48 #include "libm.h"
49
50 double
51 __frexp(double x, int *exp) {
52 union {
|
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 #pragma weak frexp = __frexp
31
32 /*
33 * frexp(x, exp) returns the normalized significand of x and sets
34 * *exp so that x = r*2^(*exp) where r is the return value. If x
35 * is finite and nonzero, 1/2 <= |r| < 1.
36 *
37 * If x is zero, infinite or NaN, frexp returns x and sets *exp = 0.
38 * (The relevant standards do not specify *exp when x is infinite or
39 * NaN, but this code sets it anyway.)
40 *
41 * If x is a signaling NaN, this code returns x without attempting
42 * to raise the invalid operation exception. If x is subnormal,
43 * this code treats it as nonzero regardless of nonstandard mode.
44 */
45
46 #include "libm.h"
47
48 double
49 __frexp(double x, int *exp) {
50 union {
|