<-- Previous || Up || Next -->

Integer Part Function
Math Reals Class

Public Function IntegerPart( _
    ByVal vNumber As Variant _
    ) As Variant

"Integer Part Of Real Number"
Return the largest integer less than or equal to vNumber when vNumber is positive.
Return the smallest integer greater than or equal to vNumber when vNumber is negative.
Same as the FixReal function.

Examples:
    IntegerPart(2.6) = 2
    IntegerPart(2) = 2
    IntegerPart(.4) = 0
    IntegerPart(-.4) = 0
    IntegerPart(-2.6) = -2
    IntegerPart(-2.6E4) = -26000
See also:
    IntegerPartVerify Subroutine
    FractionalPart Function
    Fix Function (Visual Basic)
Note: The FractionalPart function returns the fractional part of a number.

vNumber: The real number whose integer part is returned. Function returns Null if vNumber is Null or cannot be fixed up to a number.
Note: This function is similar to the Visual Basic Fix function, except that this one supports three-valued logic.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.