Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
70a66c9d
Commit
70a66c9d
authored
Feb 18, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notes to __builtin__.float() and string.atof() that the NaN and Inf
results are possible but non-portable.
parent
d60ec8f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
Doc/lib/libfuncs.tex
Doc/lib/libfuncs.tex
+11
-7
Doc/lib/libstring.tex
Doc/lib/libstring.tex
+9
-5
No files found.
Doc/lib/libfuncs.tex
View file @
70a66c9d
...
...
@@ -231,13 +231,17 @@ removed.
\begin{funcdesc}
{
float
}{
x
}
Convert a string or a number to floating point. If the argument is a
string, it must contain a possibly signed decimal or floating point
number, possibly embedded in whitespace, or be
\code
{
'NaN'
}
(case
insensitive); this behaves identical to
\code
{
string.atof(
\var
{
x
}
)
}
. If the string is
\code
{
'NaN'
}
, the
IEEE ``Not a Number'' value is returned. Otherwise, the argument
may be a plain or long integer or a floating point number, and a
floating point number with the same value (within Python's floating
point precision) is returned.
number, possibly embedded in whitespace; this behaves identical to
\code
{
string.atof(
\var
{
x
}
)
}
. Otherwise, the argument may be a plain
or long integer or a floating point number, and a floating point
number with the same value (within Python's floating point
precision) is returned.
\strong
{
Note:
}
When passing in a string, values for NaN
\index
{
NaN
}
and Infinity
\index
{
Infinity
}
may be returned, depending on the
underlying C library. The specific set of strings accepted which
cause these values to be returned depends entirely on the C library
and is known to vary.
\end{funcdesc}
\begin{funcdesc}
{
getattr
}{
object, name
}
...
...
Doc/lib/libstring.tex
View file @
70a66c9d
...
...
@@ -59,11 +59,15 @@ The functions defined in this module are:
\begin{funcdesc}
{
atof
}{
s
}
Convert a string to a floating point number. The string must have
the standard syntax for a floating point literal in Python,
optionally preceded by a sign (
\samp
{
+
}
or
\samp
{
-
}
), or be
\code
{
'NaN'
}
(case insensitive) to indicate the IEEE ``Not a
Number'' value. Note that this behaves identical to the built-in
function
\function
{
float()
}
\bifuncindex
{
float
}
when passed a
string.
optionally preceded by a sign (
\samp
{
+
}
or
\samp
{
-
}
). Note that
this behaves identical to the built-in function
\function
{
float()
}
\bifuncindex
{
float
}
when passed a string.
\strong
{
Note:
}
When passing in a string, values for NaN
\index
{
NaN
}
and Infinity
\index
{
Infinity
}
may be returned, depending on the
underlying C library. The specific set of strings accepted which
cause these values to be returned depends entirely on the C library
and is known to vary.
\end{funcdesc}
\begin{funcdesc}
{
atoi
}{
s
\optional
{
, base
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment