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

Divide Offset By One Function
Math Reals Class

Public Function DivideOffsetByOne( _
      ByVal vOne As Variant _
    , ByVal vTwo As Variant _
    ) As Variant

"Divide Offset By One"
Integer division offset by one (except that the function does accept floating-point numbers).

Examples:
    DivideOffsetByOne(-3, 2) = -2
    DivideOffsetByOne(-2, 2) = -1
    DivideOffsetByOne(-1, 2) = -1
    DivideOffsetByOne(0, 2) =  0
    DivideOffsetByOne(1, 2) =  1
    DivideOffsetByOne(2, 2) = 1
    DivideOffsetByOne(3, 2) = 2
    DivideOffsetByOne(4, 2) = 2
    DivideOffsetByOne(6, -2) = -3
    DivideOffsetByOne(-6, 2) = -3
    DivideOffsetByOne(-6, -2) = 3
See also:
    DivideOffsetByOneVerify Subroutine
    ModOffsetByOne Function
    Div Function
vOne: The dividend; real number which is to be divided by the other number. Function returns Null if vOne is Null or cannot be fixed up to a number.

vTwo: The divisor; number of times that vOne is to be divided. Function returns Null if vTwo is Null or cannot be fixed up to a number.

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