1 '\" te
   2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH fesetprec 3M "12 Jul 2006" "SunOS 5.11" "Mathematical Library Functions"
   7 .SH NAME
   8 fesetprec, fegetprec \- control floating point rounding precision modes
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 c99 [ \fIflag\fR... ] \fIfile\fR... -lm [ \fIlibrary\fR... ]
  13 #include <fenv.h> 
  14 
  15 \fBint\fR \fBfesetprec\fR(\fBint\fR \fIprec\fR);
  16 .fi
  17 
  18 .LP
  19 .nf
  20 \fBint\fR \fBfegetprec\fR(\fBvoid\fR);
  21 .fi
  22 
  23 .SH DESCRIPTION
  24 .sp
  25 .LP
  26 The IEEE 754 standard defines rounding precision modes for systems that always
  27 deliver intermediate results to destinations in extended double precision
  28 format. These modes allow such systems to deliver correctly rounded single and
  29 double precision results (in the absence of underflow and overflow) with only
  30 one rounding.
  31 .sp
  32 .LP
  33 The \fBfesetprec()\fR function sets the current rounding precision to the
  34 precision specified by \fIprec\fR, which must be one of the following values
  35 defined in <\fBfenv.h\fR>:
  36 .sp
  37 .ne 2
  38 .mk
  39 .na
  40 \fB\fBFE_FLTPREC\fR\fR
  41 .ad
  42 .RS 15n
  43 .rt  
  44 round to single precision
  45 .RE
  46 
  47 .sp
  48 .ne 2
  49 .mk
  50 .na
  51 \fB\fBFE_DBLPREC\fR\fR
  52 .ad
  53 .RS 15n
  54 .rt  
  55 round to double precision
  56 .RE
  57 
  58 .sp
  59 .ne 2
  60 .mk
  61 .na
  62 \fB\fBFE_LDBLPREC\fR\fR
  63 .ad
  64 .RS 15n
  65 .rt  
  66 round to extended double precision
  67 .RE
  68 
  69 .sp
  70 .LP
  71 The default rounding precision when a program starts is \fBFE_LDBLPREC\fR.
  72 .sp
  73 .LP
  74 The \fBfegetprec()\fR function returns the current rounding precision.
  75 .SH RETURN VALUES
  76 .sp
  77 .LP
  78 The \fBfesetprec()\fR function returns a non-zero value if the requested
  79 rounding precision is established and 0 otherwise.
  80 .SH ATTRIBUTES
  81 .sp
  82 .LP
  83 See \fBattributes\fR(5) for descriptions of the following attributes:
  84 .sp
  85 
  86 .sp
  87 .TS
  88 tab() box;
  89 lw(2.75i) lw(2.75i) 
  90 lw(2.75i) lw(2.75i) 
  91 .
  92 ATTRIBUTE TYPEATTRIBUTE VALUE
  93 ArchitectureIntel (see below)
  94 AvailabilitySUNWlibms
  95 Interface StabilityStable
  96 MT-LevelMT-Safe
  97 .TE
  98 
  99 .sp
 100 .LP
 101 These functions are not available on SPARC systems because SPARC processors
 102 deliver intermediate results to destinations in single or double format as
 103 determined by each floating point instruction.
 104 .SH SEE ALSO
 105 .sp
 106 .LP
 107 \fBfegetenv\fR(3M), \fBfesetround\fR(3M), \fBattributes\fR(5)
 108 .sp
 109 .LP
 110 \fINumerical\fR \fIComputation\fR \fIGuide\fR