Prefix methods with a dot
This commit is contained in:
parent
f670414395
commit
049aeb104d
5 changed files with 27 additions and 27 deletions
|
|
@ -1827,7 +1827,7 @@
|
|||
"\n",
|
||||
"The Python [documentation <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/tutorial/floatingpoint.html) provides another good discussion of floats and the goodness of their approximations.\n",
|
||||
"\n",
|
||||
"If we are interested in the exact bits behind a `float` object, we use the [hex() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.hex) method that returns a `str` object beginning with `\"0x1.\"` followed by the $fraction$ in hexadecimal notation and the $exponent$ as an integer after subtraction of $1023$ and separated by a `\"p\"`."
|
||||
"If we are interested in the exact bits behind a `float` object, we use the [.hex() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.hex) method that returns a `str` object beginning with `\"0x1.\"` followed by the $fraction$ in hexadecimal notation and the $exponent$ as an integer after subtraction of $1023$ and separated by a `\"p\"`."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1875,7 +1875,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"Also, the [as_integer_ratio() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.as_integer_ratio) method returns the two smallest integers whose ratio best approximates a `float` object."
|
||||
"Also, the [.as_integer_ratio() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.as_integer_ratio) method returns the two smallest integers whose ratio best approximates a `float` object."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -2030,7 +2030,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"As seen in [Chapter 1 <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_nb.png\">](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/01_elements/00_content.ipynb#%28Data%29-Type-%2F-%22Behavior%22), the [is_integer() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.is_integer) method tells us if a `float` can be casted as an `int` object without any loss in precision."
|
||||
"As seen in [Chapter 1 <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_nb.png\">](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/01_elements/00_content.ipynb#%28Data%29-Type-%2F-%22Behavior%22), the [.is_integer() <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/stdtypes.html#float.is_integer) method tells us if a `float` can be casted as an `int` object without any loss in precision."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -2091,7 +2091,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"As the exact implementation of floats may vary and be dependent on a particular Python installation, we look up the [float_info <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/sys.html#sys.float_info) attribute in the [sys <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/sys.html) module in the [standard library <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/index.html) to check the details. Usually, this is not necessary."
|
||||
"As the exact implementation of floats may vary and be dependent on a particular Python installation, we look up the [.float_info <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/sys.html#sys.float_info) attribute in the [sys <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/sys.html) module in the [standard library <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/index.html) to check the details. Usually, this is not necessary."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"A `complex` number comes with two **attributes** `real` and `imag` that return the two parts as `float` objects on their own."
|
||||
"A `complex` number comes with two **attributes** `.real` and `.imag` that return the two parts as `float` objects on their own."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -640,7 +640,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"Also, a `conjugate()` method is bound to every `complex` object. The [complex conjugate <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_wiki.png\">](https://en.wikipedia.org/wiki/Complex_conjugate) is defined to be the complex number with identical real part but an imaginary part reversed in sign."
|
||||
"Also, a `.conjugate()` method is bound to every `complex` object. The [complex conjugate <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_wiki.png\">](https://en.wikipedia.org/wiki/Complex_conjugate) is defined to be the complex number with identical real part but an imaginary part reversed in sign."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue