Previous Page Next Page Contents

Dom::Integer -- the ring of integer numbers

Introduction

Dom::Integer is the ring of integer numbers represented by elements of the domain DOM_INT.

Creating Elements

Dom::Integer(x)

Parameters

x - an integer

Categories

Cat::EuclideanDomain

, Cat::FactorialDomain, Cat::DifferentialRing, Cat::OrderedSet

Related Domains

Dom::Complex, Dom::Float, Dom::Numerical, Dom::Rational, Dom::Real

Details

Method associates: associate elements

Method _divide: division of two objects

Method _divides: decide if a number divides another one

Method euclideanDegree: Euclidean degree

Method factor: factorization

Method gcd: gcd computation

Method gcdex: applies the extended Euclidean algorithm

Method _invert: inverse of an element

Method irreducible: prime number test

Method isUnit: tests if an element is a unit

Method lcm: computes the lcm

Method quo: computes the euclidean quotient

Method random: random number generation

Method rem: computes the Euclidean reminder

Method unitNormal: unit normal part

Method unitNormalRep: unit normal representation

Method convert: conversion of objects

Method convert_to: conversion to other domains

Method testtype: type checking

Example 1

Creating some integer numbers using Dom::Integer. This example also shows that Dom::Integer is a faēcade domain.

>> Dom::Integer(2); domtype(%)
                                     2
      
                                  DOM_INT
>> Dom::Integer(2/3)
      Error: illegal arguments [Dom::Integer::new]

Example 2

By tracing the method Dom::Integer::testtype we can see the interaction between testtype and Dom::Integer::testtype.

>> prog::trace(Dom::Integer::testtype):
   delete x:
   testtype(x, Dom::Integer);
   testtype(3, Dom::Integer);
   prog::untrace(Dom::Integer::testtype):
      enter 'Dom::Integer::testtype'         with args   : x, Dom::Integer
      leave 'Dom::Integer::testtype'         with result : FAIL
      
                                   FALSE
      enter 'Dom::Integer::testtype'         with args   : 3, Dom::Integer
      leave 'Dom::Integer::testtype'         with result : TRUE
      
                                   TRUE

Super-Domain

Dom::Numerical

Axioms

Ax::canonicalRep

, Ax::systemRep, Ax::canonicalOrder, Ax::canonicalUnitNormal, Ax::closedUnitNormals, Ax::efficientOperation("_divide"), Ax::efficientOperation("_mult")

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000