INFINITY
Most languages have a number that means “bigger than anything”, usually as a special value hidden inside their floats. satellite gives infinity a type of its own: satellite.variable.infinity. It is larger than every number there is, and its negative is smaller than every number.
Making an infinity
satellite.infinity() makes one. It shows as (infinity), in brackets, because an infinity is one value and the brackets hold it together. A minus in front turns it over: (-infinity).
(satellite)
satellite.capsule satellite.main()
{
satellite.variable.infinity forever = satellite.infinity()
satellite.console.display(forever)
satellite.console.display(-forever)
satellite.console.display(forever > 10 ^ 100)
satellite.console.display(-forever < 0 - 10 ^ 300)
satellite.console.display(b1010 < forever)
satellite.console.display(forever == -forever)
satellite.console.display(forever == satellite.infinity())
satellite.return(satellite)
}(infinity)
(-infinity)
true
true
true
false
true10 ^ 100 is a one followed by a hundred zeros, and infinity is still larger. You can compare an infinity with ==, !=, <, >, <= and >= against a whole number, a binary, or another infinity.
A starting point that anything beats
The most useful thing about infinity is that every number is smaller. That makes it a natural starting value when you are looking for the smallest of something: the first real value you meet will beat it, and so will every smaller one after that. It also sorts: infinity always goes last, and (-infinity) always goes first.
(satellite)
satellite.capsule satellite.main()
{
satellite.container.list prices = {12, 7, 30, 9}
satellite.variable.infinity cheapest = satellite.infinity()
satellite.statement.for (satellite.variable.number i = 1; i <= 4; i++)
{
satellite.statement.if (prices[i] < cheapest)
{
cheapest = prices[i]
}
}
satellite.console.display(cheapest)
satellite.variable.infinity top = satellite.infinity()
satellite.container.list values = {5, top, -top, 0, 42}
satellite.console.display(values.sort().by_value())
satellite.return(satellite)
}7
{(-infinity), 0, 5, 42, (infinity)}cheapest starts as infinity and is given each price that is lower than it, so it ends as 7. This works because an infinity name also holds a plain whole number. The items of a list count from 1, so the loop runs from 1 to 4. See LISTS for more about satellite.container.list and sorting.
What an infinity takes and gives
- An infinity name also takes a plain whole number:
satellite.variable.infinity limit = 7holds 7. It refuses a string, a binary and a percentage. - A
satellite.variable.numbername refuses an infinity, because no whole number is that large. .stringgives its text,(infinity)..number,.binaryand.hexare refused, because there is no number to make of it, and.reverse()is refused because it has no digits to turn round.
(satellite)
satellite.capsule satellite.main()
{
satellite.variable.infinity forever = satellite.infinity()
satellite.console.display(forever.number)
satellite.return(satellite)
}--------------------------------------------------------------------------------
SATELLITE CRITICAL ERROR REPORT
--------------------------------------------------------------------------------
S301: TYPES_DO_NOT_MEET
satl(run): forever.number was written on an infinity, and an infinity is larger
than every number -- there is no number to make of it
directory: no_number.satl:6
syntax: satellite.console.display(forever.number)
/\
this operator has no scenario for the two kinds it was given. Nothing was
guessed at, because a guess here is an answer that is wrong and does not say so.
machine code 27 types_do_not_meet -- satl exits with this.
--------------------------------------------------------------------------------Not built yet
Arithmetic with an infinity is not built yet. +, -, *, / and ^ on an infinity are each refused by name with S210 (“not built yet”), and so is satellite.infinity(x) with something between its brackets. Today an infinity is made, shown, compared and sorted.
Where next
The FULL REFERENCE lists every infinity word. The numbers an infinity is compared with are in NUMBERS, and the other exact number types are in FRACTIONS and PERCENTAGES.
