#### Wiki source for KeyPgInt

Show raw source

{{fbdoc item="title" value="INT"}}----
Returns the floor of a number

{{fbdoc item="syntax"}}##
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Int** ( [[KeyPgByval|byval]] //number// [[KeyPgAs|as]] [[KeyPgSingle|single]] ) [[KeyPgAs|as]] [[KeyPgSingle|single]]
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Int** ( [[KeyPgByval|byval]] //number// [[KeyPgAs|as]] [[KeyPgDouble|double]] ) [[KeyPgAs|as]] [[KeyPgDouble|double]]
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Int** ( [[KeyPgByval|byval]] //number// [[KeyPgAs|as]] [[KeyPgInteger|integer]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Int** ( [[KeyPgByval|byval]] //number// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]]
##
{{fbdoc item="usage"}}##
//result// = **Int**( //number// )
##
{{fbdoc item="param"}}
##//number//##
the floating-point number to round

{{fbdoc item="ret"}}
Returns the floor of ##//number//##, i.e. the largest integer that is less than or equal to it.

{{fbdoc item="desc"}}
##**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.

The ##**Int**## unary ##[[KeyPgOperator|operator]]## can be overloaded with user defined types.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/math/int.bas"}}%%(freebasic)
Print int(1.9) '' will print 1
Print int(-1.9) '' will print -2
%%

{{fbdoc item="lang"}}
- In the //[[CompilerOptlang|-lang qb]]// dialect, this operator cannot be overloaded.

{{fbdoc item="diff"}}
- None

{{fbdoc item="see"}}
- ##[[KeyPgFix|Fix]]##
- ##[[KeyPgCint|Cint]]##
- ##[[KeyPgOperator|Operator]]##

{{fbdoc item="back" value="CatPgMath|Math"}}