Skip to content

DOUBLE

Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgDouble Last revised: 2016-03-12

Standard data type: 64-bit floating point.

Syntax

Dim variable As Double

Description

Double is a 64-bit, floating-point data type used to store more precise decimal numbers. They can hold:

  • Positive values: 4.940656458412465e-324 to 1.797693134862316e+308
  • Negative values: -4.940656458412465e-324 to -1.797693134862316e+308
  • Zero (0)

They contain at most 53 bits of precision, or about 15 decimal digits. Doubles have a greater range and precision than Singles, but they still have limited accuracy which can lead to significant inaccuracies if not used properly. They are dyadic numbers — they can only accurately hold multiples of powers of two, which will lead to inaccuracies in most base-10 fractions.

Examples

vb
'Example of using a double variable.
Dim a As Double
a = 1.985766472453666
Print a
Sleep

Differences from QB

  • None.

See Also

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft