pyxx.numbers.is_float¶
- pyxx.numbers.is_float(value: Any)¶
Checks whether a value is a floating-point number
Determines whether a value can be converted to a real number and expressed as a Python
float.- Parameters:
value (Any) – The value to be analyzed
- Returns:
Whether
valuerepresents a floating-point number- Return type:
bool
Examples
Decimal numbers and integers are identified as floating-point numbers:
>>> pyxx.numbers.is_float(3.14) True >>> pyxx.numbers.is_float(3) True >>> pyxx.numbers.is_float(2/3) True
This function checks if values can be converted to floating-point numbers, so string inputs may also be classified as valid floating-point numbers:
>>> pyxx.numbers.is_float('-6.28') True