Упорядочивание проекта
This commit is contained in:
parent
0dcd9c0d4d
commit
89dfd7644b
32 changed files with 1730 additions and 1719 deletions
|
|
@ -25,8 +25,17 @@ extern inline void bgc_cotes_number_swap_fp64(BgcCotesNumberFP64* number1, BgcCo
|
|||
extern inline void bgc_cotes_number_convert_fp64_to_fp32(const BgcCotesNumberFP64* source, BgcCotesNumberFP32* destination);
|
||||
extern inline void bgc_cotes_number_convert_fp32_to_fp64(const BgcCotesNumberFP32* source, BgcCotesNumberFP64* destination);
|
||||
|
||||
extern inline void bgc_cotes_number_invert_fp32(const BgcCotesNumberFP32* number, BgcCotesNumberFP32* inverted);
|
||||
extern inline void bgc_cotes_number_invert_fp64(const BgcCotesNumberFP64* number, BgcCotesNumberFP64* inverted);
|
||||
extern inline void bgc_cotes_number_make_opposite_fp32(BgcCotesNumberFP32* number);
|
||||
extern inline void bgc_cotes_number_make_opposite_fp64(BgcCotesNumberFP64* number);
|
||||
|
||||
extern inline void bgc_cotes_number_get_opposite_fp32(const BgcCotesNumberFP32* number, BgcCotesNumberFP32* opposite);
|
||||
extern inline void bgc_cotes_number_get_opposite_fp64(const BgcCotesNumberFP64* number, BgcCotesNumberFP64* opposite);
|
||||
|
||||
extern inline void bgc_cotes_number_invert_fp32(BgcCotesNumberFP32* number);
|
||||
extern inline void bgc_cotes_number_invert_fp64(BgcCotesNumberFP64* number);
|
||||
|
||||
extern inline void bgc_cotes_number_get_inverse_fp32(const BgcCotesNumberFP32* number, BgcCotesNumberFP32* inverse);
|
||||
extern inline void bgc_cotes_number_get_inverse_fp64(const BgcCotesNumberFP64* number, BgcCotesNumberFP64* inverse);
|
||||
|
||||
extern inline void bgc_cotes_number_get_exponation_fp32(const BgcCotesNumberFP32* base, const float exponent, BgcCotesNumberFP32* power);
|
||||
extern inline void bgc_cotes_number_get_exponation_fp64(const BgcCotesNumberFP64* base, const double exponent, BgcCotesNumberFP64* power);
|
||||
|
|
@ -52,34 +61,34 @@ extern inline void bgc_cotes_number_turn_vector_back_fp64(const BgcCotesNumberFP
|
|||
extern inline int bgc_cotes_number_are_close_fp32(const BgcCotesNumberFP32* number1, const BgcCotesNumberFP32* number2);
|
||||
extern inline int bgc_cotes_number_are_close_fp64(const BgcCotesNumberFP64* number1, const BgcCotesNumberFP64* number2);
|
||||
|
||||
void _bgc_cotes_number_normalize_fp32(const float square_modulus, _BgcTwinCotesNumberFP32* twin)
|
||||
void _bgc_cotes_number_normalize_fp32(const float square_modulus, BgcCotesNumberFP32* number)
|
||||
{
|
||||
// (square_modulus != square_modulus) is true when square_modulus is NaN
|
||||
|
||||
if (square_modulus <= BGC_SQUARE_EPSYLON_FP32 || square_modulus != square_modulus) {
|
||||
twin->cos = 1.0f;
|
||||
twin->sin = 0.0f;
|
||||
number->_cos = 1.0f;
|
||||
number->_sin = 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
const float multiplier = sqrtf(1.0f / square_modulus);
|
||||
|
||||
twin->cos *= multiplier;
|
||||
twin->sin *= multiplier;
|
||||
number->_cos *= multiplier;
|
||||
number->_sin *= multiplier;
|
||||
}
|
||||
|
||||
void _bgc_cotes_number_normalize_fp64(const double square_modulus, _BgcTwinCotesNumberFP64* twin)
|
||||
void _bgc_cotes_number_normalize_fp64(const double square_modulus, BgcCotesNumberFP64* number)
|
||||
{
|
||||
// (square_modulus != square_modulus) is true when square_modulus is NaN
|
||||
|
||||
if (square_modulus <= BGC_SQUARE_EPSYLON_FP64 || square_modulus != square_modulus) {
|
||||
twin->cos = 1.0;
|
||||
twin->sin = 0.0;
|
||||
number->_cos = 1.0;
|
||||
number->_sin = 0.0;
|
||||
return;
|
||||
}
|
||||
|
||||
const double multiplier = sqrt(1.0 / square_modulus);
|
||||
|
||||
twin->cos *= multiplier;
|
||||
twin->sin *= multiplier;
|
||||
number->_cos *= multiplier;
|
||||
number->_sin *= multiplier;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue