VF_roundtoI | VD_roundtoI | VE_roundtoI |
VF_roundtoBI | VD_roundtoBI | VE_roundtoBI |
VF_roundtoSI | VD_roundtoSI | VE_roundtoSI |
VF_roundtoLI | VD_roundtoLI | VE_roundtoLI |
VF_roundtoQI | VD_roundtoQI | VE_roundtoQI |
VF_roundtoU | VD_roundtoU | VE_roundtoU |
VF_roundtoUB | VD_roundtoUB | VE_roundtoUB |
VF_roundtoUS | VD_roundtoUS | VE_roundtoUS |
VF_roundtoUL | VD_roundtoUL | VE_roundtoUL |
VF_roundtoUQ | VD_roundtoUQ | VE_roundtoUQ |
VF_roundtoUI | VD_roundtoUI | VE_roundtoUI |
|
Function | Rounding to the nearest whole number. |
|
Syntax C/C++ | #include <VFmath.h>
int VF_round( fVector Y, fVector X, ui size );
int VF_roundtoI( iVector Y, fVector X, ui size );
int VF_roundtoLI( liVector Y, fVector X, ui size );
(similarly all other functions of this family) |
C++ VecObj | #include <OptiVec.h>
int vector<T>::round( const vector<T>& X );
int vector<int>::roundtoI( const vector<T>& X );
int vector<long>::roundtoLI( const vector<T>& X ); |
Pascal/Delphi | uses VFmath;
function VF_round( Y, X:fVector; size:UIntSize ): IntBool;
function VF_roundtoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_roundtoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;
(similarly all other functions of this family) |
|
CUDA function C/C++ | #include <cudaVFmath.h>
int cudaVF_round( fVector d_Y, fVector d_X, ui size );
int cudaVF_roundtoI( iVector d_Y, fVector d_X, ui size );
int VFcu_round( fVector h_Y, fVector h_X, ui size );
int VFcu_roundtoI( iVector h_Y, fVector h_X, ui size );
|
CUDA function Pascal/Delphi | uses VFmath;
function cudaVF_round( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_roundtoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_round( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_roundtoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
|
|
Description | Each element of X is rounded to the nearest integer value. In case of a fractional part of exactly 0.5, the nearest even integer value is chosen and stored in Y. For example, 2.5 is rounded to 2, and 3.5 is rounded to 4.
The functions VF_roundtoI, VF_roundtoLI, VF_roundtoU, etc. convert the result into the various integer data types. |
|
Error handling | OVERFLOW and DOMAIN errors are handled "silently", i.e., without any error message and without being indicated by the return value. In the case of OVERFLOW errors, the result is set to the extreme value possible. Negative numbers in the versions VF_roundtoU, VF_roundtoUB, VF_roundtoUS, VF_roundtoUL, and VF_roundtoUI (which would lead to DOMAIN errors) are handled by setting the result to 0. |
|
Return value | always FALSE (0) |
|
|