Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.

google.appengine.ext.db.FloatProperty.data_type

Convert a string or number to a floating point number, if possible.

Inherits From: expected_type

imag the imaginary part of a complex number
real the real part of a complex number

Methods

as_integer_ratio

Return integer ratio.

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

Create a floating-point number from a hexadecimal string.

>>> float.fromhex('0x1.ffffp10')
2047.984375
>>> float.fromhex('-0x1p-1074')
-5e-324

hex

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.

__abs__

abs(self)

__add__

Return self+value.

__bool__

self != 0

__eq__

Return self==value.

__floordiv__

Return self//value.

__ge__

Return self>=value.

__gt__

Return self>value.

__le__

Return self<=value.

__lt__

Return self<value.

__mod__

Return self%value.

__mul__

Return self*value.

__ne__

Return self!=value.

__neg__

-self

__pos__

+self

__pow__

Return pow(self, value, mod).

__radd__

Return value+self.

__rfloordiv__

Return value//self.

__rmod__

Return value%self.

__rmul__

Return value*self.

__rpow__

Return pow(value, self, mod).

__rsub__

Return value-self.

__rtruediv__

Return value/self.

__sub__

Return self-value.

__truediv__

Return self/value.