VF_chopVD_chopVE_chop
VF_choptoIVD_choptoIVE_choptoI
VF_choptoBIVD_choptoBIVE_choptoBI
VF_choptoSIVD_choptoSIVE_choptoSI
VF_choptoLIVD_choptoLIVE_choptoLI
VF_choptoQIVD_choptoQIVE_choptoQI
VF_choptoUVD_choptoUVE_choptoU
VF_choptoUBVD_choptoUBVE_choptoUB
VF_choptoUSVD_choptoUSVE_choptoUS
VF_choptoULVD_choptoULVE_choptoUL
VF_choptoUQVD_choptoUQVE_choptoUQ
VF_choptoUIVD_choptoUIVE_choptoUI
Function"Chopping" towards zero.
Syntax C/C++#include <VFmath.h>
int VF_chop( fVector Y, fVector X, ui size );
int VF_choptoI( iVector Y, fVector X, ui size );
int VF_choptoLI( liVector Y, fVector X, ui size );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
int vector<T>::chop( const vector<T>& X );
int vector<int>::choptoI( const vector<T>& X );
int vector<long>::choptoLI( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_chop( Y, X:fVector; size:UIntSize ): IntBool;
function VF_choptoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_choptoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_chop( fVector d_Y, fVector d_X, ui size );
int cudaVF_choptoI( iVector d_Y, fVector d_X, ui size );
int VFcu_chop( fVector h_Y, fVector h_X, ui size );
int VFcu_choptoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_chop( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_choptoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_chop( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_choptoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionEach element of X is rounded to an integer number by "chopping off" the fractional part. For example, -3.9 yields -3, and +3.9 yields +3. The result is stored in Y. The functions VF_choptoI,   VF_choptoLI, etc. convert the result into the various integer data types.
Error handlingOVERFLOW errors are handled by setting the result to the extreme value possible. Negative numbers in the versions VF_choptoU,   VF_choptoUS,   VF_choptoUL, and VF_choptoUI lead to DOMAIN errors; they are handled by setting the result to 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_round,   VF_floor,   VF_ceil,   ceil,   floor (C/C++ only)

VectorLib Table of Contents  OptiVec home