25、'float', 用于将整数和字符串转换成浮点数。

class float(object)
| float(x) -> floating point number
|
| Convert a string or number to a floating point number, if possible.
|
| Methods defined here:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| self != 0
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __format__(...)
| float.__format__(format_spec) -> string
|
| Formats the float according to format_spec.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getformat__(...) from builtins.type
| float.__getformat__(typestr) -> string
|
| You probably don't want to use this function. It exists mainly to be
| used in Python's test suite.
|
| typestr must be 'double' or 'float'. This function returns whichever of
| 'unknown', 'IEEE, big-endian' or 'IEEE, little-endian' best describes the
| format of floating point numbers used by the C type named by typestr.
|
| __getnewargs__(...)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __int__(self, /)
| int(self)
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __repr__(self, /)
| Return repr(self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __round__(...)
| Return the Integral closest to x, rounding half toward even.
| When an argument is passed, work like built-in round(x, ndigits).
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __setformat__(...) from builtins.type
| float.__setformat__(typestr, fmt) -> None
|
| You probably don't want to use this function. It exists mainly to be
| used in Python's test suite.
|
| typestr must be 'double' or 'float'. fmt must be one of 'unknown',
| 'IEEE, big-endian' or 'IEEE, little-endian', and in addition can only be
| one of the latter two if it appears to match the underlying C reality.
|
| Override the automatic determination of C-level floating point type.
| This affects how floats are converted to and from binary strings.
|
| __str__(self, /)
| Return str(self).
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Return the Integral closest to x between 0 and x.
|
| as_integer_ratio(...)
| float.as_integer_ratio() -> (int, int)
|
| Return a pair of integers, whose ratio is exactly equal to the original
| float and with a positive denominator.
| Raise OverflowError on infinities and a ValueError on NaNs.
|
| >>> (10.0).as_integer_ratio()
| (10, 1)
| >>> (0.0).as_integer_ratio()
| (0, 1)
| >>> (-.25).as_integer_ratio()
| (-1, 4)
|
| conjugate(...)
| Return self, the complex conjugate of any float.
|
| fromhex(...) from builtins.type
| float.fromhex(string) -> float
|
| Create a floating-point number from a hexadecimal string.
| >>> float.fromhex('0x1.ffffp10')
| 2047.984375
| >>> float.fromhex('-0x1p-1074')
| -5e-324
|
| hex(...)
| float.hex() -> string
|
| Return a hexadecimal representation of a floating-point number.
| >>> (-0.1).hex()
| '-0x1.999999999999ap-4'
| >>> 3.14159.hex()
| '0x1.921f9f01b866ep+1'
|
| is_integer(...)
| Return True if the float is an integer.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| imag
| the imaginary part of a complex number
|
| real
| the real part of a complex number

  

最新文章

  1. Android自定义View初步
  2. 怎样写一个webpack loader
  3. jQuery的$.getJSON方法在IE浏览器下失效的解决方案
  4. Yii入门☞应用
  5. 编辑距离及其动态规划算法(Java代码)
  6. 不能读取文件“itunes.library.itl”因为它是由更高级别的itunes所创建的
  7. 04.spring-data-redis与Jedis整合使用
  8. Codeforces Round #206 (Div. 1)B(记忆化)
  9. linux别名
  10. C++对象模型笔记之程序设计模型
  11. BZOJ 3238: [Ahoi2013]差异 [后缀自动机]
  12. css属性应用bug大杂烩(后续继续更新)
  13. Fiddler抓取https的设置
  14. Django 自定义过滤器
  15. MySQL基础--字符函数
  16. SpringBoot document notes
  17. JMeter(二十二)与其它工具对比(转载)
  18. 利用sdkman安装kotlin和java环境
  19. smarty学习——变量
  20. Java Error: Failed to validate certificate. The application will not be executed

热门文章

  1. Solidworks如何显示装饰螺纹线
  2. Solidworks如何创建投影曲线
  3. linux find 命令查找 复制
  4. VBscript 做的设置网卡名称
  5. [Elasticsearch] 部分匹配 (四) - 索引期间优化ngrams及索引期间的即时搜索
  6. Makefile:1: *** 多个目标匹配。 停止。
  7. mysql的binlog详解
  8. bootstrap-Table服务端分页,获取到的数据怎么再页面的表格里显示
  9. String,StringBuilder与StringBuffer的区别
  10. 浏览器上的Qt Quick