Properties of numbers#
Test for signbit#
- ctx.signbit(x)#
where
ctxismath53,ctxboostorctxflint.Returns
Trueif 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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(x\) is neither \(+\infty\) nor \(-\infty\) norNaN.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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.Returns
Trueif \(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
ctxismath53,ctxboostorctxflint.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
ctxismath53,ctxboostorctxflint.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