eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'MetaNumber':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: MetaNumber


Inheritance:

   Object
   |
   +--Magnitude
      |
      +--ArithmeticValue
         |
         +--Number
            |
            +--MetaNumber
               |
               +--Infinity
               |
               +--NotANumber
               |
               +--SomeNumber

Package:
stx:libbasic
Category:
Magnitude-Numbers
Version:
rev: 1.4 date: 2017/06/21 18:46:19
user: cg
file: MetaNumber.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Claus Gittinger

Description:


Common behavior for metaNumbers (INF, NaN).


Related information:

    Number
    Infinity
    NotANumber
    Float
    ShortFloat
    Fraction
    FixedPoint
    Integer
    Complex
    FloatArray
    DoubleArray

Class protocol:

queries
o  isAbstract


Instance protocol:

coercing & converting
o  asFloat
return a Float with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.

o  asFraction

o  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.

o  asInteger

o  asLargeFloat

o  asLongFloat
return a LongFloat with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.

o  asQDouble
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

o  asShortFloat
return a Float with same value as the receiver.
For anything but NaN, +Inf or -Inf, an error is raised here.

o  coerce: aNumber
convert the argument aNumber into an instance of the receiver's class and return it.

o  generality
NaN, INF etc. are more general than scalars, but not more general than
vectors (e.g. Points)



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 24 Apr 2024 18:56:13 GMT