|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Returns the floor of a number.
int(value)
Menu Location
This command can't be found in any menu besides the command catalog.
This command works on all calculators.
1 byte
The int() command rounds a number down to the nearest integer less than or equal to the number. For instance, int(π) returns 3, while int(-π) returns -4.
The command is an alias for floor(): they do the exact same thing. The calculator prefers using floor() (in fact, int() will be converted to floor() in symbolic expressions); int() is left over from earlier calculator models. Other rounding commands include:
- ceiling() — like floor(), but always rounds up (to the next higher integer).
- iPart() — truncates a number to just its integer part (or, if you prefer, rounds a number toward 0).
- round() — rounds to a specific place value, not just to an integer, but round(x,0) will round x to the nearest integer, up or down.
int() can also be applied to complex numbers, lists, and matrices, rounding everything that there is to round in each of them.
:int(3)
3
:int({-π,π})
{-4 3}