VF_choptoI | VD_choptoI | VE_choptoI |
VF_choptoBI | VD_choptoBI | VE_choptoBI |
VF_choptoSI | VD_choptoSI | VE_choptoSI |
VF_choptoLI | VD_choptoLI | VE_choptoLI |
VF_choptoQI | VD_choptoQI | VE_choptoQI |
VF_choptoU | VD_choptoU | VE_choptoU |
VF_choptoUB | VD_choptoUB | VE_choptoUB |
VF_choptoUS | VD_choptoUS | VE_choptoUS |
VF_choptoUL | VD_choptoUL | VE_choptoUL |
VF_choptoUQ | VD_choptoUQ | VE_choptoUQ |
VF_choptoUI | VD_choptoUI | VE_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/Delphi | uses 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/Delphi | uses 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;
|
|
Description | Each 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 handling | OVERFLOW 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 value | FALSE (0), if no error occurred, otherwise TRUE (non-zero). |
|
|