Repository navigation
Int
Home › Mathematical Functions › Int
Returns the largest whole number not above the value, so Int(-1.3) is -2.
Declare Function Int ( ByVal number As Single ) As Single
Declare Function Int ( ByVal number As Double ) As Double
Declare Function Int ( ByVal number As Integer ) As Integer
Declare Function Int ( ByVal number As UInteger ) As UIntegernumber
Int returns the floor of number. For example, Int(4.9) will return 4.0, and Int(-1.3) will return -2.0. For integer types, the number is returned unchanged.
Note: To return the ceiling of number, i.e. the smallest integer that is greater than or equal to it, one can use -Int( -number ).
The Int unary Operator can be overloaded with user defined types.
Returns the floor of number, i.e. the largest integer that is less than or equal to it.
result = Int( number )
- In the -lang qb dialect, this operator cannot be overloaded.
- None
Print Int(1.9) '' will print 1
Print Int(-1.9) '' will print -2Category: Mathematical Functions
Kind: function
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing