KiCad PCB EDA Suite
Loading...
Searching...
No Matches
util.cpp File Reference
#include <cmath>
#include <cstdlib>
#include <limits>
#include <math/util.h>
#include <wx/log.h>
#include <wx/string.h>

Go to the source code of this file.

Macros

#define wxASCII_STR(s)   wxString::FromAscii(s)
 

Functions

void kimathLogDebug (const char *aFormatString,...)
 Helper to avoid directly including wx/log.h for the templated functions in kimath.
 
void kimathLogOverflow (double v, const char *aTypeName)
 Workaround to avoid the empty-string conversion issue in wxWidgets.
 
template<>
int rescale (int aNumerator, int aValue, int aDenominator)
 
template<>
int64_t rescale (int64_t aNumerator, int64_t aValue, int64_t aDenominator)
 

Macro Definition Documentation

◆ wxASCII_STR

#define wxASCII_STR (   s)    wxString::FromAscii(s)

Definition at line 41 of file util.cpp.

Function Documentation

◆ kimathLogDebug()

void kimathLogDebug ( const char *  aFormatString,
  ... 
)

Helper to avoid directly including wx/log.h for the templated functions in kimath.

Definition at line 44 of file util.cpp.

Referenced by rescale().

◆ kimathLogOverflow()

void kimathLogOverflow ( double  v,
const char *  aTypeName 
)

Workaround to avoid the empty-string conversion issue in wxWidgets.

Definition at line 58 of file util.cpp.

Referenced by KiCheckedCast(), and KiROUND().

◆ rescale() [1/2]

template<>
int rescale ( int  aNumerator,
int  aValue,
int  aDenominator 
)

Definition at line 66 of file util.cpp.

◆ rescale() [2/2]

template<>
int64_t rescale ( int64_t  aNumerator,
int64_t  aValue,
int64_t  aDenominator 
)

Definition at line 80 of file util.cpp.

References std::abs(), kimathLogDebug(), and sign().