1 /* 2 * Copyright 2014, The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _MACHINE_FENV_H_ 18 #define _MACHINE_FENV_H_ 19 20 #include <sys/types.h> 21 22 typedef struct { 23 unsigned char a[128]; 24 } fenv_t; 25 typedef __uint32_t fexcept_t; 26 27 /* Exception flags. */ 28 #define FE_INVALID 0x01 29 #define FE_DIVBYZERO 0x02 30 #define FE_OVERFLOW 0x04 31 #define FE_UNDERFLOW 0x08 32 #define FE_INEXACT 0x10 33 #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID |\ 34 FE_OVERFLOW | FE_UNDERFLOW) 35 36 /* Rounding modes. */ 37 #define FE_TONEAREST 0x0 38 #define FE_UPWARD 0x1 39 #define FE_DOWNWARD 0x2 40 #define FE_TOWARDZERO 0x3 41 42 #endif /* _MACHINE_FENV_H_ */ 43