How to Return Next Upper Integer for any Real Number in Basic (80405)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System for MS-DOS 7.0
- Microsoft Basic Professional Development System for MS-DOS 7.1
- Microsoft Visual Basic Standard Edition for Windows 1.0
- Microsoft Visual Basic for MS-DOS
This article was previously published under Q80405 SUMMARY
The following formula converts any real number having a non-zero
fractional value to the next upper integer
x = - Int ( - x)
(where x can be any single or double precision number).
The Int function converts a numeric expression to the largest integer
less than or equal to the expression.
This information applies to Microsoft QuickBasic versions 1.0, 1.01,
1.02, 2.0, 2.01, 3.0, 4.0, 4.0a, 4.0b, and 4.5 for MS-DOS; Microsoft
Basic Compiler versions 6.0 and 6.0b for MS-DOS; Microsoft Basic
Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS;
and Microsoft Visual Basic programming system version 1.0 for Windows.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB80405 |
---|
|