1fesetprec(3M) Mathematical Library Functions fesetprec(3M)
2
3
4
6 fesetprec, fegetprec - control floating point rounding precision modes
7
9 c99 [ flag... ] file... -lm [ library... ]
10 #include <fenv.h>
11
12 int fesetprec(int prec);
13
14
15 int fegetprec(void);
16
17
19 The IEEE 754 standard defines rounding precision modes for systems that
20 always deliver intermediate results to destinations in extended double
21 precision format. These modes allow such systems to deliver correctly
22 rounded single and double precision results (in the absence of under‐
23 flow and overflow) with only one rounding.
24
25
26 The fesetprec() function sets the current rounding precision to the
27 precision specified by prec, which must be one of the following values
28 defined in <fenv.h>:
29
30 FE_FLTPREC round to single precision
31
32
33 FE_DBLPREC round to double precision
34
35
36 FE_LDBLPREC round to extended double precision
37
38
39
40 The default rounding precision when a program starts is FE_LDBLPREC.
41
42
43 The fegetprec() function returns the current rounding precision.
44
46 The fesetprec() function returns a non-zero value if the requested
47 rounding precision is established and 0 otherwise.
48
50 See attributes(5) for descriptions of the following attributes:
51
52
53
54
55 ┌───────────────────────────────────────────────────────────┐
56 │ATTRIBUTE TYPE ATTRIBUTE VALUE │
57 │Architecture Intel (see below) │
58 │Availability SUNWlibms │
59 │Interface Stability Stable │
60 │MT-Level MT-Safe │
61 └───────────────────────────────────────────────────────────┘
62
63
64 These functions are not available on SPARC systems because SPARC pro‐
65 cessors deliver intermediate results to destinations in single or dou‐
66 ble format as determined by each floating point instruction.
67
69 fegetenv(3M), fesetround(3M), attributes(5)
70
71
72 Numerical Computation Guide
73
74
75
76SunOS 5.11 12 Jul 2006 fesetprec(3M)