| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- output conversion
#include <floatingpoint.h>char *econvert(doublevalue,intndigit,int *decpt,int *sign,char *buf);
char *fconvert(doublevalue,intndigit,int *decpt,int *sign,char *buf);
char *gconvert(doublevalue,intndigit,inttrailing,char *buf);
char *seconvert(single *value,intndigit,int *decpt,int *sign,char *buf);
char *sfconvert(single *value,intndigit,int *decpt,int *sign,char *buf);
char *sgconvert(single *value,intndigit,inttrailing,char *buf);
char *qeconvert(quadruple *value,intndigit,int *decpt,int *sign,char *buf);
char *qfconvert(quadruple *value,intndigit,int *decpt,int *signchar *buf);
char *qgconvert(quadruple *value,intndigit,inttrailing,char *buf);
Theeconvert() function converts thevalue to a null-terminated string ofndigitASCII digits inbuf and returns a pointer tobuf.buf should containat leastndigit+1 characters. The position of the decimal point relative tothe beginning of the string is stored indirectly throughdecpt. Thusbuf== "314" and*decpt == 1 corresponds to the numerical value 3.14, whilebuf == "314" and*decpt == -1 corresponds to the numerical value.0314. If the sign of the result is negative, the word pointedto bysign is nonzero; otherwise it is zero. The least significantdigit is rounded.
Thefconvert() function works much likeeconvert(), except that the correct digithas been rounded as if forsprintf(%w.nf) output withn=ndigit digitsto the right of the decimal point.ndigit can be negative to indicaterounding to the left of the decimal point. The return value isa pointer tobuf.buf should contain at least310+max(0,ndigit) characters toaccomodate any double-precisionvalue.
Thegconvert() function converts thevalue to a null-terminated ASCII string inbuf and returns a pointer tobuf. It producesndigit significant digits infixed-decimal format, likesprintf(%w.nf), if possible, and otherwise in floating-decimal format,likesprintf(%w.ne); in either casebuf is ready for printing, withsign and exponent. The result corresponds to that obtained by
(void) sprintf(buf,``%w.ng'',value) ;
Iftrailing = 0, trailing zeros and a trailing point are suppressed,as insprintf(%g). Iftrailing != 0, trailing zeros and atrailing point are retained, as insprintf(%#g).
Theseconvert(),sfconvert(), andsgconvert() functions are single-precision versions of these functions,and are more efficient than the corresponding double-precision versions. A pointer ratherthan the value itself is passed to avoid C's usual conversion of single-precisionarguments to double.
Theqeconvert(),qfconvert(), andqgconvert() functions are quadruple-precision versions of these functions.Theqfconvert() function can overflow thedecimal_record fieldds ifvalue is too large. In that case,buf[0] is set to zero.
Theecvt(),fcvt() andgcvt() functions are versions ofeconvert(),fconvert(), andgconvert(), respectively, that are documented on theecvt(3C) manual page. Theyconstitute the default implementation of these functions and conform to the X/OpenCAE Specification, System Interfaces and Headers, Issue 4, Version 2.
IEEE Infinities and NaNs are treated similarly by these functions. ``NaN'' isreturned for NaN, and ``Inf'' or ``Infinity'' for Infinity. The longerform is produced whenndigit >= 8.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |