2021-11-12 16:27:03 +08:00
|
|
|
|
/**
|
|
|
|
|
|
********************************************************************
|
2022-01-12 21:44:58 +08:00
|
|
|
|
* @file util_math.c
|
2021-11-12 16:27:03 +08:00
|
|
|
|
* @brief
|
|
|
|
|
|
*
|
2022-01-12 21:44:58 +08:00
|
|
|
|
* @copyright (c) 2018 DJI. All rights reserved.
|
2021-11-12 16:27:03 +08:00
|
|
|
|
*
|
|
|
|
|
|
* All information contained herein is, and remains, the property of DJI.
|
|
|
|
|
|
* The intellectual and technical concepts contained herein are proprietary
|
|
|
|
|
|
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
|
|
|
|
|
* and protected by trade secret or copyright law. Dissemination of this
|
|
|
|
|
|
* information, including but not limited to data and other proprietary
|
|
|
|
|
|
* material(s) incorporated within the information, in any form, is strictly
|
|
|
|
|
|
* prohibited without the express written consent of DJI.
|
|
|
|
|
|
*
|
|
|
|
|
|
* If you receive this source code without DJI’s authorization, you may not
|
|
|
|
|
|
* further disseminate the information, and you must immediately remove the
|
|
|
|
|
|
* source code and notify DJI of its removal. DJI reserves the right to pursue
|
|
|
|
|
|
* legal actions against you for any loss(es) or damage(s) caused by your
|
|
|
|
|
|
* failure to do so.
|
|
|
|
|
|
*
|
|
|
|
|
|
*********************************************************************
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
2022-01-12 21:44:58 +08:00
|
|
|
|
#include "util_math.h"
|
|
|
|
|
|
#include "math.h"
|
2021-11-12 16:27:03 +08:00
|
|
|
|
|
|
|
|
|
|
/* Private constants ---------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Private types -------------------------------------------------------------*/
|
|
|
|
|
|
|
2022-01-12 21:44:58 +08:00
|
|
|
|
/* Private values ---------------------------------------------------------*/
|
2021-11-12 16:27:03 +08:00
|
|
|
|
|
2022-01-12 21:44:58 +08:00
|
|
|
|
/* Private functions declaration ---------------------------------------------*/
|
2021-11-12 16:27:03 +08:00
|
|
|
|
|
|
|
|
|
|
/* Exported functions definition ---------------------------------------------*/
|
2022-01-12 21:44:58 +08:00
|
|
|
|
int32_t UtilMath_Mod(int32_t a, int32_t b)
|
2021-11-12 16:27:03 +08:00
|
|
|
|
{
|
2022-01-12 21:44:58 +08:00
|
|
|
|
return a - floor((double) a / (double) b) * b;
|
2021-11-12 16:27:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Private functions definition-----------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|