CVDMBF: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "The CVDMBF function decodes an 8-byte STRING generated by MKDMBF$ (or read from a file) to DOUBLE numeric values. {{PageSyntax}} : {{Parameter|result#}} = CVDMBF({{Parameter|stringData$}}) {{PageDescription}} * ''CV'' functions (CVD, CVS, CVI, CVL, CVDMBF, CVSMBF) are used to convert values encoded by ''MK$'' functions (MKD$, MKS$, MKI$, MKL$, MKDMBF$, MKSMBF$). * '''QB64''' has _CV and _MK$...") |
No edit summary |
||
Line 32: | Line 32: | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [https://qb64phoenix.com/forum/showthread.php?tid=1066 Featured in our "Keyword of the Day" series] | |||
* [[MKD$]], [[MKI$]], [[MKS$]], [[MKL$]], [[MKDMBF$]], [[MKSMBF$]] | * [[MKD$]], [[MKI$]], [[MKS$]], [[MKL$]], [[MKDMBF$]], [[MKSMBF$]] | ||
* [[CVI]], [[CVS]], [[CVD]], [[CVL]], [[CVSMBF]] | * [[CVI]], [[CVS]], [[CVD]], [[CVL]], [[CVSMBF]] |
Latest revision as of 19:27, 24 May 2024
The CVDMBF function decodes an 8-byte STRING generated by MKDMBF$ (or read from a file) to DOUBLE numeric values.
Syntax
- result# = CVDMBF(stringData$)
Description
- CV functions (CVD, CVS, CVI, CVL, CVDMBF, CVSMBF) are used to convert values encoded by MK$ functions (MKD$, MKS$, MKI$, MKL$, MKDMBF$, MKSMBF$).
- QB64 has _CV and _MK$ functions which can also deal with extended data types.
- DOUBLE values can range up to 15 decimal point digits. Decimal point accuracy depends on whole value places taken.
Examples
Example 1: Showcases the reduced space to store an encoded number.
a# = 77000.24523213 PRINT "Value of a#:"; a# b$ = MKDMBF$(a#) PRINT "Value of a# encoded using MKDMBF$: "; b$ PRINT "The string above, decoded using CVDMBF:"; CVDMBF(b$) |
Value of a#: 77000.24523213 Value of a# encoded using MKDmbf$: 5─c▼d▬æ The string above, decoded using CVDMBF: 77000.24523213 |
- Since the representation of a double-precision number can use up to 15 ASCII characters (fifteen bytes), writing to a file using MKDMBF$ conversion, and then reading back with the CVDMBF conversion can save up to 7 bytes of storage space.
See also
- Featured in our "Keyword of the Day" series
- MKD$, MKI$, MKS$, MKL$, MKDMBF$, MKSMBF$
- CVI, CVS, CVD, CVL, CVSMBF
- _CV, _MK$