====== CINT ====== /* Remove the comments after creating content for each section.*/ Returns the value of the given floating-point value rounded to the nearest integer /* For the lines below, just create links, separated by commas, to other pages of the BASICs section, like [[:basics:basicTagName]]. "Implemented by" should mention BASICs which implement the keyword like described, in a more usual and standard way. "With variations" should point to BASICs where this keyword is used a bit differently. "Also written as" should list alternative spellings and abbreviations this keyword has. No need to refer to a BASIC, there is a section for that later. */ **Implemented by:** [[:basics:trs80:level2]], [[:basics:GWBASIC:]], [[:basics:bwbasic:]], [[:basics:bwbasic:bw32]], [[:basics:ABasiC:]], [[:basics:msqb:QBasic]], [[:basics:VBDOS:]], [[:basics:FreeBASIC:]], [[:basics:EndBASIC:]] **With variations:** [[:basics:Altair:altair12K]] (always converts to the lesser integer; overflows in values out of 16-bit range), [[:basics:MSX:]] (rounds negatives down), [[:basics:Gambas:]] **Also written as: ** ===== Usage ===== 10 PRINT CINT(41.49) ' shows "41" 20 PRINT CINT(41.51) ' shows "42" ==== Variations ==== Microsoft BASICs which implement CINT usually limit its argument to the 16-bit signed range of -32768 to 32767. A lesser or greater input value causes an overflow error. [[CLNG]] allows for bigger numbers, in the 32-bit signed range. The official documentation of [[:basics:bwbasic|Bywater BASIC 2.20]] described CINT as //"returns the truncated integer for the argument"//, which is equivalent to the [[FIX]] function that it did not implement; both keywords were implemented with their common behaviours in version 3.20. ===== Examples ===== /* Below is an example of a code block, using GeSHi syntax highlighting for //gwbasic//. Other styles of interest might be //basic4gl//, //blitzbasic//, //freebasic//, //gambas//, //locobasic//, //purebasic//, //qbasic//, //sdlbasic//, //thinbasic//, //vb//, //vbnet//, //xbasic// or //zxbasic//. 10 PRINT "HELLO" */ ===== Comments ===== /* Origin of the keyword, opinions, history... */ ===== Related keywords ===== /* Keywords that are often or always used along this one */ * [[CDBL]] * [[CLNG]] * [[CSNG]] ===== Similar keywords ===== /* Keywords with the same or similar functionality found in other versions of BASIC */ ===== In other languages... ===== /* For parallels and comparisons with other modern-day languages */ ===== References ===== /* If you used the ((citation)) syntax elsewhere in the text, they will appear under this section. But you can write some recommendations of books, magazines, etc */ /* ===== TAGS ===== Please use the syntax below for adding tags to this page, separated by spaces (use quotes for tags with spaces). The most important tags to be used are, separated by groups: - Statements | Commands | SpecialVariables | Operators {{tag>tagName}} */ {{tag>Functions Conversion}}