logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

atof.3p (2515B)


  1. '\" et
  2. .TH ATOF "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. atof
  12. \(em convert a string to a double-precision number
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. double atof(const char *\fIstr\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The call
  26. .IR atof ( str )
  27. shall be equivalent to:
  28. .sp
  29. .RS 4
  30. .nf
  31. strtod(\fIstr\fP,(char **)NULL),
  32. .fi
  33. .P
  34. .RE
  35. .P
  36. except that the handling of errors may differ. If the value cannot be
  37. represented, the behavior is undefined.
  38. .SH "RETURN VALUE"
  39. The
  40. \fIatof\fR()
  41. function shall return the converted value if the value can be
  42. represented.
  43. .SH ERRORS
  44. No errors are defined.
  45. .LP
  46. .IR "The following sections are informative."
  47. .SH EXAMPLES
  48. None.
  49. .SH "APPLICATION USAGE"
  50. The
  51. \fIatof\fR()
  52. function is subsumed by
  53. \fIstrtod\fR()
  54. but is retained because it is used extensively in existing code. If the
  55. number is not known to be in range,
  56. \fIstrtod\fR()
  57. should be used because
  58. \fIatof\fR()
  59. is not required to perform any error checking.
  60. .SH RATIONALE
  61. None.
  62. .SH "FUTURE DIRECTIONS"
  63. None.
  64. .SH "SEE ALSO"
  65. .IR "\fIstrtod\fR\^(\|)"
  66. .P
  67. The Base Definitions volume of POSIX.1\(hy2017,
  68. .IR "\fB<stdlib.h>\fP"
  69. .\"
  70. .SH COPYRIGHT
  71. Portions of this text are reprinted and reproduced in electronic form
  72. from IEEE Std 1003.1-2017, Standard for Information Technology
  73. -- Portable Operating System Interface (POSIX), The Open Group Base
  74. Specifications Issue 7, 2018 Edition,
  75. Copyright (C) 2018 by the Institute of
  76. Electrical and Electronics Engineers, Inc and The Open Group.
  77. In the event of any discrepancy between this version and the original IEEE and
  78. The Open Group Standard, the original IEEE and The Open Group Standard
  79. is the referee document. The original Standard can be obtained online at
  80. http://www.opengroup.org/unix/online.html .
  81. .PP
  82. Any typographical or formatting errors that appear
  83. in this page are most likely
  84. to have been introduced during the conversion of the source files to
  85. man page format. To report such errors, see
  86. https://www.kernel.org/doc/man-pages/reporting_bugs.html .