Previous Page Next Page Contents

Dom::Float -- the real floating point numbers

Introduction

Dom::Float is the set of real floating point numbers represented by elements of the domain DOM_FLOAT.

Creating Elements

Dom::Float(x)

Parameters

x - an expression which can be converted to a DOM_FLOAT by the function float.

Categories

Cat::DifferentialRing

, Cat::Field, Cat::OrderedSet

Related Domains

Dom::Complex, Dom::Integer, Dom::Numerical, Dom::Rational, Dom::Real

Details

Entries

one

the unit element; it equals 1.0.

zero

The zero element; it equals 0.0.

Method random: random number generation

Method convert: conversion of objects

Method convert_to: conversion to other domains

Method testtype: type checking

Example 1

Creating some floating point numbers using Dom::Float. This example also shows that Dom::Float is a facade domain.

>> Dom::Float(2.3); domtype(%) 
                                    2.3
      
                                 DOM_FLOAT
>> Dom::Float(sin(2/3*PI) + 3)
                                3.866025404
>> Dom::Float(sin(x))
      Error: illegal arguments [Dom::Float::new]

Example 2

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

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

Super-Domain

Dom::Numerical

Axioms

Ax::canonicalRep

, Ax::systemRep, Ax::canonicalOrder, Ax::efficientOperation("_divide"), Ax::efficientOperation("_mult"), Ax::efficientOperation("_invert")

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000