1521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih/*
2521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * Copyright 2013, The Android Open Source Project
3521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih *
4521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * Licensed under the Apache License, Version 2.0 (the "License");
5521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * you may not use this file except in compliance with the License.
6521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * You may obtain a copy of the License at
7521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih *
8521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih *     http://www.apache.org/licenses/LICENSE-2.0
9521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih *
10521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * Unless required by applicable law or agreed to in writing, software
11521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * distributed under the License is distributed on an "AS IS" BASIS,
12521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * See the License for the specific language governing permissions and
14521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih * limitations under the License.
15521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih */
16521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih
17521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#ifndef _FENV_PORTABLE_H_
18521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define _FENV_PORTABLE_H_
19521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih
20521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#include <sys/types.h>
21521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih
22521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih/* Exception flags. */
23521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_INVALID_PORTABLE    0x01
24521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_DIVBYZERO_PORTABLE  0x02
25521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_OVERFLOW_PORTABLE   0x04
26521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_UNDERFLOW_PORTABLE  0x08
27521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_INEXACT_PORTABLE    0x10
28521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_ALL_EXCEPT_PORTABLE (FE_DIVBYZERO_PORTABLE | FE_INEXACT_PORTABLE | FE_INVALID_PORTABLE |\
29521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih                                FE_OVERFLOW_PORTABLE | FE_UNDERFLOW_PORTABLE)
30521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih
31521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih/* Rounding modes. */
32521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_TONEAREST_PORTABLE  0x0
33521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_UPWARD_PORTABLE     0x1
34521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_DOWNWARD_PORTABLE   0x2
35521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#define FE_TOWARDZERO_PORTABLE 0x3
36521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih
37521bcfb17ac113b11c244cefe286fdceca203c47Lai Wei-Chih#endif /* _FENV_PORTABLE_H_ */
38