83 lines
1.9 KiB
C++
83 lines
1.9 KiB
C++
//
|
|
// Academic License - for use in teaching, academic research, and meeting
|
|
// course requirements at degree granting institutions only. Not for
|
|
// government, commercial, or other organizational use.
|
|
//
|
|
// File: rt_nonfinite.cpp
|
|
//
|
|
// Code generated for Simulink model 'cmdvel2gazebo'.
|
|
//
|
|
// Model version : 1.73
|
|
// Simulink Coder version : 8.12 (R2017a) 16-Feb-2017
|
|
// C/C++ source code generated on : Tue May 22 14:50:02 2018
|
|
//
|
|
// Target selection: ert.tlc
|
|
// Embedded hardware selection: Custom Processor->Custom
|
|
// Code generation objectives: Unspecified
|
|
// Validation result: Not run
|
|
//
|
|
|
|
//
|
|
// Abstract:
|
|
// Function to initialize non-finites,
|
|
// (Inf, NaN and -Inf).
|
|
#include "rt_nonfinite.h"
|
|
#include "rtGetNaN.h"
|
|
#include "rtGetInf.h"
|
|
|
|
extern "C" {
|
|
real_T rtInf;
|
|
real_T rtMinusInf;
|
|
real_T rtNaN;
|
|
real32_T rtInfF;
|
|
real32_T rtMinusInfF;
|
|
real32_T rtNaNF;
|
|
}
|
|
extern "C"
|
|
{
|
|
//
|
|
// Initialize the rtInf, rtMinusInf, and rtNaN needed by the
|
|
// generated code. NaN is initialized as non-signaling. Assumes IEEE.
|
|
//
|
|
void rt_InitInfAndNaN(size_t realSize)
|
|
{
|
|
(void) (realSize);
|
|
rtNaN = rtGetNaN();
|
|
rtNaNF = rtGetNaNF();
|
|
rtInf = rtGetInf();
|
|
rtInfF = rtGetInfF();
|
|
rtMinusInf = rtGetMinusInf();
|
|
rtMinusInfF = rtGetMinusInfF();
|
|
}
|
|
|
|
// Test if value is infinite
|
|
boolean_T rtIsInf(real_T value)
|
|
{
|
|
return (boolean_T)((value==rtInf || value==rtMinusInf) ? 1U : 0U);
|
|
}
|
|
|
|
// Test if single-precision value is infinite
|
|
boolean_T rtIsInfF(real32_T value)
|
|
{
|
|
return (boolean_T)(((value)==rtInfF || (value)==rtMinusInfF) ? 1U : 0U);
|
|
}
|
|
|
|
// Test if value is not a number
|
|
boolean_T rtIsNaN(real_T value)
|
|
{
|
|
return (boolean_T)((value!=value) ? 1U : 0U);
|
|
}
|
|
|
|
// Test if single-precision value is not a number
|
|
boolean_T rtIsNaNF(real32_T value)
|
|
{
|
|
return (boolean_T)(((value!=value) ? 1U : 0U));
|
|
}
|
|
}
|
|
|
|
//
|
|
// File trailer for generated code.
|
|
//
|
|
// [EOF]
|
|
//
|