Revision history for KeyPgCint


Revision [21671]

Last edited on 2016-11-07 05:25:14 by fxm [Formatting]
Additions:
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger|Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
Deletions:
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger|Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##648##.


Revision [21668]

Edited on 2016-11-07 05:08:47 by fxm [Formatting]
Additions:
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger|Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##648##.
Deletions:
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger|Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.


Revision [20842]

Edited on 2016-03-12 15:36:25 by fxm [Formatting]

No Differences

Revision [20084]

Edited on 2016-02-10 15:55:30 by DkLwikki [Update link format]
Additions:
Converts a numeric or string expression to an ##[[KeyPgInteger|Integer]]## or an ##[[KeyPgInteger|Integer]]<//bits//>##
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Cint** ( [[KeyPgByval|byval]] //expression// [[KeyPgAs|as]] [[DataType|datatype]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Cint**<//bits//> ( [[KeyPgByval|byval]] //expression// [[KeyPgAs|as]] [[DataType|datatype]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]<//bits//>
[[KeyPgType|Type]] //typename//
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] [[KeyPgCast|cast]] ( ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] [[KeyPgCast|cast]] ( ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]<//bits//>
a numeric, string, or pointer expression to cast to a ##[[KeyPgInteger|Integer]]## value
An ##[[KeyPgInteger|Integer]]## or ##[[KeyPgInteger|Integer]]<//bits//>## containing the converted value.
If ##**Cint**## is passed a numeric ##//expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method|round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns an ##[[KeyPgInteger|Integer]]##, or if a ##//bits//## value is supplied, an integer type of the given size.
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger|Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
If the argument is a string expression, it is converted to numeric by using ##[[KeyPgValint|Valint]]## or ##[[KeyPgVallng|Vallng]]##, depending on the size of the result type.
- In the //[[CompilerOptlang|-lang qb]]// dialect, ##**Cint**## will return a 16-bit integer, like in QB.
- ##[[KeyPgCast|Cast]]##
- ##[[KeyPgCbyte|Cbyte]]##
- ##[[KeyPgCubyte|Cubyte]]##
- ##[[KeyPgCshort|Cshort]]##
- ##[[KeyPgCushort|Cushort]]##
- ##[[KeyPgCuint|Cuint]]##
- ##[[KeyPgClng|Clng]]##
- ##[[KeyPgCulng|Culng]]##
- ##[[KeyPgClngint|Clngint]]##
- ##[[KeyPgCulngint|Culngint]]##
- ##[[KeyPgCsng|Csng]]##
- ##[[KeyPgCdbl|Cdbl]]##
- ##[[KeyPgInteger|Integer]]##
Deletions:
Converts a numeric or string expression to an ##[[KeyPgInteger Integer]]## or an ##[[KeyPgInteger Integer]]<//bits//>##
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Cint** ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Cint**<//bits//> ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]<//bits//>
[[KeyPgType Type]] //typename//
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] [[KeyPgCast cast]] ( ) [[KeyPgAs as]] [[KeyPgInteger integer]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] [[KeyPgCast cast]] ( ) [[KeyPgAs as]] [[KeyPgInteger integer]]<//bits//>
a numeric, string, or pointer expression to cast to a ##[[KeyPgInteger Integer]]## value
An ##[[KeyPgInteger Integer]]## or ##[[KeyPgInteger Integer]]<//bits//>## containing the converted value.
If ##**Cint**## is passed a numeric ##//expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns an ##[[KeyPgInteger Integer]]##, or if a ##//bits//## value is supplied, an integer type of the given size.
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
If the argument is a string expression, it is converted to numeric by using ##[[KeyPgValint Valint]]## or ##[[KeyPgVallng Vallng]]##, depending on the size of the result type.
- In the //[[CompilerOptlang -lang qb]]// dialect, ##**Cint**## will return a 16-bit integer, like in QB.
- ##[[KeyPgCast Cast]]##
- ##[[KeyPgCbyte Cbyte]]##
- ##[[KeyPgCubyte Cubyte]]##
- ##[[KeyPgCshort Cshort]]##
- ##[[KeyPgCushort Cushort]]##
- ##[[KeyPgCuint Cuint]]##
- ##[[KeyPgClng Clng]]##
- ##[[KeyPgCulng Culng]]##
- ##[[KeyPgClngint Clngint]]##
- ##[[KeyPgCulngint Culngint]]##
- ##[[KeyPgCsng Csng]]##
- ##[[KeyPgCdbl Cdbl]]##
- ##[[KeyPgInteger Integer]]##


Revision [16693]

Edited on 2013-03-28 11:31:23 by DkLwikki [Update for 64bit branch]
Additions:
Converts a numeric or string expression to an ##[[KeyPgInteger Integer]]## or an ##[[KeyPgInteger Integer]]<//bits//>##
Deletions:
Converts numeric or string expression to an ##[[KeyPgInteger Integer]]## or an ##[[KeyPgInteger Integer]]<//bits//>##.


Revision [16691]

Edited on 2013-03-28 11:29:10 by DkLwikki [Update for 64bit branch]
Additions:
If ##**Cint**## is passed a numeric ##//expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns an ##[[KeyPgInteger Integer]]##, or if a ##//bits//## value is supplied, an integer type of the given size.

Deletions:
If ##**Cint**## is passed a numeric ##//expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##, or if a ##//bits//## value is supplied, an integer type of the given size.


Revision [16611]

Edited on 2013-02-27 00:21:25 by CountingPine [Add <bits> to CInt<bits> return type]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Cint**<//bits//> ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]<//bits//>
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Cint**<//bits//> ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]


Revision [16608]

Edited on 2013-02-27 00:02:11 by CountingPine [Add <bits> to CInt<bits> return type]
Deletions:
SLEEP


Revision [16607]

Edited on 2013-02-27 00:01:52 by CountingPine [Add <bits> to CInt<bits> return type]
Additions:
If the argument is a string expression, it is converted to numeric by using ##[[KeyPgValint Valint]]## or ##[[KeyPgVallng Vallng]]##, depending on the size of the result type.
Deletions:
If the argument is a string expression, it is converted to numeric by using ##[[KeyPgValint Valint]]##.


Revision [16606]

Edited on 2013-02-26 23:54:49 by CountingPine [Add <bits> to CInt<bits> return type]
Additions:
Converts numeric or string expression to an ##[[KeyPgInteger Integer]]## or an ##[[KeyPgInteger Integer]]<//bits//>##.
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] [[KeyPgCast cast]] ( ) [[KeyPgAs as]] [[KeyPgInteger integer]]<//bits//>
##//bits//##
A numeric constant expression indicating the size in bits of integer desired. The values allowed are ##8##, ##16##, ##32## or ##64##.
Deletions:
Converts numeric or string expression to an ##[[KeyPgInteger Integer]]##
##<//bits//>##
A numeric constant expression indicating the size in bits of integer desired. The values allowed are ##8##, ##16##, ##32## or ##64##.


Revision [16605]

Edited on 2013-02-26 23:51:54 by CountingPine [New feature: CInt<n>()]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Cint**<//bits//> ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]
##<//bits//>##
A numeric constant expression indicating the size in bits of integer desired. The values allowed are ##8##, ##16##, ##32## or ##64##.
An ##[[KeyPgInteger Integer]]## or ##[[KeyPgInteger Integer]]<//bits//>## containing the converted value.
If ##**Cint**## is passed a numeric ##//expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##, or if a ##//bits//## value is supplied, an integer type of the given size.
The function does not check for an overflow; for example, for a 32-bit ##[[KeyPgInteger Integer]]## the results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
- The ##<//bits//>## parameter was not allowed in QB
- ##[[KeyPgInteger Integer]]##
Deletions:
An ##[[KeyPgInteger Integer]]## value.
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for an overflow, and results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.


Revision [15777]

Edited on 2012-01-23 15:52:19 by CountingPine [Readd "undefined results" message]
Additions:
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for an overflow, and results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
Deletions:
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for overflow.


Revision [15629]

Edited on 2012-01-12 13:24:23 by AgAmemnus [No such thing as undefined results.]
Additions:
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for overflow.
Deletions:
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for an overflow, and results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.


Revision [13757]

Edited on 2008-09-30 18:24:30 by CountingPine [No such thing as undefined results.]
Additions:
//result// = **Cint**( //expression// )
If ##**Cint**## is passed a ##//numeric expression//##, it rounds it using using the [[http://en.wikipedia.org/wiki/Rounding#Round-to-even_method round-to-even method]] - i.e. it rounds to the closest integer value, choosing the closest even integer if the number is equidistant from two integers - and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for an overflow, and results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##647##.
The name "CINT" is derived from 'Convert to INTeger'.
- ##[[KeyPgCast Cast]]##
Deletions:
//result// = **Cint**( //numeric expression// )
The ##**Cint**## function rounds the decimal part of ##//numeric expression//## using the round-to-even method ( http://en.wikipedia.org/wiki/Rounding#Round-to-even_method ) and returns a 32-bit ##[[KeyPgInteger Integer]]##. The function does not check for an overflow, so be sure not to pass a value which is less than -2 147 483 648 or larger than 2 147 483 647. The name is derived from 'Convert to INTeger'.


Revision [13447]

The oldest known version of this page was created on 2008-06-12 10:05:51 by ChA0s [No such thing as undefined results.]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode