© Tyl Software Foundation 2019-2021

▶ REAL NUMBERS

Real number is any number in the range { -∞, ∞ }.

Consider this program:

weight 10.75

print weight

10.75

First, we assign the real value 10.75, to the

For numbers that their integral component is zero, the zero sign can be omitted:

`weight`

real variable. The decimal
point '.', is mandatory, for the system to treat a numeric value as a real
number.
For numbers that their integral component is zero, the zero sign can be omitted:

halfnumwithzerosign 0.5

halfnum .5

print halfnum / halfnumwithzerosign

1

The result of a mathematical operation between two numbers will be real, if one
of them is real:

onedividedbyrealtwo 1 / 2.0

print onedividedbyrealtwo

0.5

Tyl supports composite mathematical calculations as long as the operands are of
numeric type:

num 10000

real 1000000.30030009

bignum 10000000003

print num - bignum / real

print 3 / 1000 - ( num - bignum / real )

print 1.20780902640449E-12 + num - bignum / real

0.00299999999879219

1.20780902640449E-12

0.00300000000061118

1.20780902640449E-12

0.00300000000061118