SINGLE: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "'''SINGLE''' variables are 4 byte floating decimal point numerical values up to seven digits in length. {{PageSyntax}} :: DIM ''variable'' AS SINGLE {{PageDescription}} * Values can range up to 7 digits. Decimal point accuracy depends on whole value places taken. * Single is the '''default variable type''' assigned to undefined variables without a type suffix. * Variable suffix type designation is '''!'''. Suffix can also be placed after a literal numerical value...")
 
m (Removed protection from "SINGLE")
 
(2 intermediate revisions by 2 users not shown)
Line 13: Line 13:
* Floating decimal point numerical values cannot be [[_UNSIGNED]]!
* Floating decimal point numerical values cannot be [[_UNSIGNED]]!
* Values can be converted to 4 byte [[ASCII]] string values using [[_MKS$]] and back with [[_CVS]].
* Values can be converted to 4 byte [[ASCII]] string values using [[_MKS$]] and back with [[_CVS]].
* '''Warning: Qbasic keyword names cannot be used as numerical variable names with or without the type suffix!'''
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix!'''





Latest revision as of 21:55, 1 June 2022

SINGLE variables are 4 byte floating decimal point numerical values up to seven digits in length.


Syntax

DIM variable AS SINGLE


Description

  • Values can range up to 7 digits. Decimal point accuracy depends on whole value places taken.
  • Single is the default variable type assigned to undefined variables without a type suffix.
  • Variable suffix type designation is !. Suffix can also be placed after a literal numerical value by user or automatically by the IDE.
  • Values returned may be expressed using exponential or scientific notation using E for SINGLE or D for DOUBLE precision.
  • Floating decimal point numerical values cannot be _UNSIGNED!
  • Values can be converted to 4 byte ASCII string values using _MKS$ and back with _CVS.
  • Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix!


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage