Difference between revisions of "CSNG"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 3: Line 3:
  
  
::::::'''Syntax:''' CSNG(n)
+
{{PageSyntax}}
 +
:: singlevalue = '''CSNG('''''expression''''')'''
  
  
 +
{{Parameters}}
 +
* The ''expression'' is any [[TYPE]] of literal or variable numerical value or mathematical calculation.
  
* n must be a numeric value (see the CINT and CDBL functions).
+
 
* Also used to define a value as SINGLE-precision.
+
{{PageDescription}}
 +
* Returns the closest [[SINGLE]] decimal point value
 +
* Also used to define a value as [[SINGLE]]-precision.
  
  
 
''Example:''
 
''Example:''
 
 
{{CodeStart}}
 
{{CodeStart}}
 
  A# = 975.3421222#
 
  A# = 975.3421222#
 
  PRINT A#, CSNG(A#)
 
  PRINT A#, CSNG(A#)
 
{{CodeEnd}}
 
{{CodeEnd}}
 
+
{{OutputStart}}975.3421222      975.3421
{{OutputStart}}  
 
975.3421222      975.3421
 
 
{{OutputEnd}}
 
{{OutputEnd}}
 
  
  
 
''See also:''  
 
''See also:''  
 
+
* [[CDBL]], [[CLNG]]  
[[CDBL]], [[CLNG]], [[CINT]], [[INT]], [[_ROUND]]
+
* [[CINT]], [[INT]]  
 
+
* [[_ROUND]]
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Revision as of 19:33, 3 January 2016

CSNG To converts a numerical value to the closest SINGLE-precision number.


Syntax

singlevalue = CSNG(expression)


Parameters

  • The expression is any TYPE of literal or variable numerical value or mathematical calculation.


Description

  • Returns the closest SINGLE decimal point value
  • Also used to define a value as SINGLE-precision.


Example:

A# = 975.3421222# PRINT A#, CSNG(A#)

975.3421222      975.3421


See also:



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page