Previous Page Next Page Contents

numlib::decimal -- infinite representation of rational numbers

Introduction

numlib::decimal(q) computes the decimal expansion of a rational number q.

Call(s)

numlib::decimal(q)

Parameters

q - nonnegative rational number

Returns

numlib::decimal(q) returns an expression sequence consisting of nonnegative integers or an expression sequence consisting of nonnegative integers and terminated by a list of nonnegative integers.

Details

Example 1

Computing the decimal expansion of :

>> numlib::decimal(1999)
                                   1999

Example 2

Computing the (finite) decimal expansion of :

>> numlib::decimal(52187/78125)
                          0, 6, 6, 7, 9, 9, 3, 6

Example 3

Computing the (infinite) decimal expansion of :

>> numlib::decimal(111/7)
                          15, [8, 5, 7, 1, 4, 2]

Example 4

Computing the (infinite) decimal expansion of :

>> numlib::decimal(37/28)
                        1, 3, 2, [1, 4, 2, 8, 5, 7]

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000