e r l a n g : c o o k b o o k

/ Erlang.NumberIntroduction

This Web


WebHome 
WebChanges 
TOC
NewRecipe 
WebTopicList 
WebStatistics 

All Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Erlang Links


Erlang.org
Erlang Wiki
ErlMan
Erlang Wiki
The Jungerl
Erlang-fr.org
Joe Armstrong
Lambda the Ultimate

Erlang Web Ring


[Prev]: Joe Armstrong's Page
[Next]: Joe Armstrong's Page

Introduction

Numbers are basic to just about any computation. They're used for array indexes, temperatures, salaries, and an infinite variety of things. Yet they're not as simple as they seem. With floating-point numbers, how accurate is accurate? With random numbers, how random is random? With strings that should contain a number, what actually constitutes a number?.

It is important to distinguish between the mathematical numbers, the Erlang numbers that attempt to model them, the machine representations used to implement the Erlang numbers, and notations used to write numbers. We uses the types number, complex, real, rational, and integer to refer to both mathematical numbers and Erlang numbers. Machine representations such as fixed point and floating point are referred to by names such as fixnum and flonum.

Erlang's numerical operations treat numbers as abstract data, as independent of their representation as possible. Although an implementation of Erlang may use fixnum, flonum, and perhaps other representations for numbers, this should not be apparent to a casual programmer writing simple programs.

Contributors

Based on work by ChandraQuintas.

-- BrentAFulgham - 23 Aug 2004

CookbookForm
TopicType: Section
ParentTopic: NumberChapter
TopicOrder: 010

 
 
Copyright © 2004 by the contributing authors. All material on the Erlang Cookbook web site is the property of the contributing authors.
This material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest