]>
git.saurik.com Git - apple/libc.git/blob - ppc/gen/fp.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 /* Copyright (c) 1992, NeXT Computer, Inc. All rights reserved.
25 * File: libc/m98k/gen/fp.h
26 * Author: Derek B Clegg, NeXT Computer, Inc.
29 * 11-Nov-92 Derek B Clegg (dclegg@next.com)
32 * Common definitions for floating-point numbers.
35 /* The following definitions for for double precision IEEE format numbers. */
37 #define EXPONENT_BIAS 1023
40 #define EXPONENT_BITS 11
41 #define FRACTION_BITS 52
42 #define HI_FRACTION_BITS 20
43 #define LO_FRACTION_BITS 32
45 struct double_format
{
46 unsigned sign
: SIGN_BITS
;
47 unsigned exponent
: EXPONENT_BITS
;
48 unsigned hi_fraction
: HI_FRACTION_BITS
;
49 unsigned lo_fraction
: LO_FRACTION_BITS
;
53 struct double_format s
;
58 #define PlusInfinity (1.0/0.0)
59 #define MinusInfinity (-1.0/0.0)
61 #define not_a_number(x) ((x) != (x))
62 #define positive_infinity(x) ((x) == PlusInfinity)
63 #define negative_infinity(x) ((x) == MinusInfinity)