Properties of numbers#

Test for signbit#

ctx.signbit(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if the sign bit of \(x\) is set.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsInfinity(0.5)
False
>>> xreal.IsInfinity('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsInfinity(0.5)
False
>>> Gpr.IsInfinity('inf')
True

Test for a finite number#

ctx.isfinite(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is neither \(+\infty\) nor \(-\infty\) nor NaN.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsFinite(0.5)
False
>>> xreal.IsFinite('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsFinite(0.5)
False
>>> Gpr.IsFinite('inf')
True

Test for infinity#

ctx.isinf(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is either \(+\infty\) or \(-\infty\).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsInfinity(0.5)
False
>>> xreal.IsInfinity('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsInfinity(0.5)
False
>>> Gpr.IsInfinity('inf')
True

Test for positive infinity#

ctx.isposinf(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is \(+\infty\).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsPositiveInfinity(0.5)
False
>>> xreal.IsPositiveInfinity('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsPositiveInfinity(0.5)
False
>>> Gpr.IsPositiveInfinity('inf')
True

Test for negative infinity#

ctx.isneginf(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is \(-\infty\).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNegativeInfinity(0.5)
False
>>> xreal.IsNegativeInfinity('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNegativeInfinity(0.5)
False
>>> Gpr.IsNegativeInfinity('inf')
True

Test for NaN#

ctx.isnan(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is Nan (Not a number).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test for zero#

ctx.iszero(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is 0 (+0 or -0).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test for one#

ctx.isone(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is 1.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number is an integer#

ctx.isinteger(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is an integer.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number is a simple number (not an infinity or NaN)#

ctx.isnumber(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is an integer.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number is a regular number (not zero, an infinity or NaN)#

ctx.isregular(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is a regular number (not zero, an infinity or NaN).

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number is a normal number (not subnormal, zero, an infinity or NaN)#

ctx.isnormal(x)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) is a normal number (not subnormal, zero, an infinity or NaN)

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if 2 numbers are unordered#

ctx.isunordered(x, y)#

where ctx is math53, ctxboost or ctxflint.

Returns True if \(x\) and \(y\) are unordered.

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number fits in a signed 32 bit integer#

ctx.fitsint32(x)#

where ctx is math53, ctxboost or ctxflint.

Test if a number fits in a signed 32 bit integer

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True

Test if a number fits in a signed 64 bit integer#

ctx.fitsint64(x)#

where ctx is math53, ctxboost or ctxflint.

Test if a number fits in a signed 64 bit integer

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.IsNan(0.5)
False
>>> xreal.IsNan('inf')
True

An example in Visual Basic

>>> from xlcalcnet import Gpr
>>> Gpr.IsNan(0.5)
False
>>> Gpr.IsNan('inf')
True