# Real

is the head used for real (floatingpoint) numbers.

# Details • _Real can be used to stand for a real number in a pattern.
• You can enter a floatingpoint number of any length.
• You can enter a number in scientific notation by using the form mantissa*^exponent.
• You can enter a floatingpoint number in base b using b^^digits. The base can be up to 36. The letters az or AZ are used in sequence to stand for digits 10 through 35.
• Real is also used to indicate an approximate real number in Read.

# Examples

open allclose all

## Basic Examples(1)

Enter a real number:

Real is the Head for real numbers:

## Scope(11)

Real numbers entered with just a few digits are generally represented as machine reals:

Enter a real number with many significant digits:

Arbitrary-precision reals are used when too many digits are given for a machine number:

Its Accuracy is based on the number of digits to the right of the decimal point:

Enter a real number with a specified Precision:

Enter a real number with a specified Accuracy:

Enter a real number with an exponent:

Enter a real number with an exponent and specified precision:

Enter a real number in binary:

Enter a real number in binary with precision specified in terms of bits:

Enter a real number in hexadecimal:

Enter a real number in base 35:

Format a real number using base 2:

_Real can be used to represent a real number in a pattern:

A rule that replaces real numbers with nearby rationals:

## Applications(4)

Determine if a matrix consists entirely of approximate reals:

A rule that rounds all reals to have two digits after the decimal point:

Divide a restaurant bill to the nearest penny:

Define a function that only works for reals:

Define a function that has a special case for reals:

For integers and rationals use the corresponding approximate real:

## Properties & Relations(5)

Reals are numbers:

Real is used for approximate reals:

Reals are atomic objects with no subexpressions:

Use different formats for displaying a real number:

Use Reals in assumptions and to indicate domain conditions:

## Possible Issues(1)

Real is only the head for approximate real numbers:

You can use the following function to test for numbers on the real axis: