Divides two or more 64-bit integer (Large) expressions.
l = x Div8 y( operator)
l = Div8(x, y [,m,…])( function)
x, y, m , l:large exp
Div8 is a Large integer division function. Values are converted to 64-bit integers before the division is performed. Internally, GFA-BASIC 32 uses CLarge() for the conversion (which isn't the same as Round).
Note There is no 64-bit version of the Div command to add an expression to a variable, because Div is type independent and works with Large types as well.
' Div as operator
Print 2 Div8 2.50 // Prints 1
Print 2 Div8 2.51 // Prints 0
' Div as a function
Print Div8(126, Succ(2))// Prints 42
Although Div8 can be used with any numeric data type variable, the usage of integer variables is recommended in order to achieve the maximum optimization for speed (no coercion to 32 bit before the operation is performed).
Div8 doesn't test for overflow!
Add8, Sub8, Mul8, Mod8, +, -, *, /, \, ++, --, +=, -=, /= , *=, Operator Hierarchy
{Created by Sjouke Hamstra; Last updated: 01/10/2014 by James Gaite}