|
Class: MetaNumber
Object
|
+--Magnitude
|
+--ArithmeticValue
|
+--Number
|
+--MetaNumber
|
+--Infinity
|
+--NotANumber
|
+--SomeNumber
- Package:
- stx:libbasic
- Category:
- Magnitude-Numbers
- Version:
- rev:
1.16
date: 2021/12/15 00:00:23
- user: cg
- file: MetaNumber.st directory: libbasic
- module: stx stc-classLibrary: libbasic
Common behavior for metaNumbers (INF, NaN).
copyrightCOPYRIGHT (c) 2003 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
queries
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
coercing & converting
-
asFloat
-
return a Float (i.e. an IEEE double) with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
MetaNumber infinity asFloat
MetaNumber negativeInfinity asFloat
MetaNumber NaN asFloat
|
-
asFraction
-
consistency with other converters
-
asInstanceOf: aFloatClass fromSelector: selector
-
common code for asShortFloat, asFloat, ...
Return an instance of aFloatClass with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
-
asInteger
-
(comment from inherited method)
return an integer with same value - might truncate
-
asIntegerChecked
-
Infinity positive asInteger
Infinity positive asIntegerChecked
Infinity negative asInteger
Infinity negative asIntegerChecked
-
asLargeFloat
( an extension from the stx:libbasic2 package )
-
return a LongFloat with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
MetaNumber infinity asLargeFloat
MetaNumber negativeInfinity asLargeFloat
MetaNumber NaN asLargeFloat
|
-
asLongFloat
-
return a LongFloat with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
MetaNumber infinity asLongFloat
MetaNumber negativeInfinity asLongFloat
MetaNumber NaN asLongFloat
|
-
asOctaFloat
( an extension from the stx:libbasic2 package )
-
return an OctaFloat with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
Infinity NaN asFloat
Infinity NaN asOctaFloat
Infinity positive asFloat
Infinity positive asOctaFloat
Infinity negative asFloat
Infinity negative asOctaFloat
|
-
asQDouble
( an extension from the stx:libbasic2 package )
-
return a QDouble with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
Infinity NaN asFloat
Infinity NaN asQDouble
Infinity positive asFloat
Infinity positive asQDouble
Infinity negative asFloat
Infinity negative asQDouble
|
-
asQuadFloat
( an extension from the stx:libbasic2 package )
-
return a QuadFloat with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
Usage example(s):
Infinity NaN asFloat
Infinity NaN asQuadFloat
Infinity positive asFloat
Infinity positive asQuadFloat
Infinity negative asFloat
Infinity negative asQuadFloat
|
-
asShortFloat
-
return a Float with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
-
asTrueFraction
-
return a Fraction with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.
-
coerce: aNumber
-
convert the argument aNumber into an instance of the receiver's class and return it.
-
generality
-
NaN, INF etc. are more general than scalars, but not more general than
vectors (e.g. Points)
|