Makefile.am,cwMath.h/cpp : Initial commit.

This commit is contained in:
kevin 2020-12-29 10:09:03 -05:00
parent 721d9e79a1
commit 556cfe7f2b
3 changed files with 25 additions and 2 deletions

View File

@ -4,8 +4,8 @@ libcwSRC =
libcwHDR += src/libcw/cwCommon.h src/libcw/cwCommonImpl.h src/libcw/cwMem.h src/libcw/cwLog.h src/libcw/cwUtility.h
libcwSRC += src/libcw/cwCommonImpl.cpp src/libcw/cwMem.cpp src/libcw/cwLog.cpp src/libcw/cwUtility.cpp
libcwHDR += src/libcw/cwString.h src/libcw/cwVectOps.h src/libcw/cwMtx.h src/libcw/cwVariant.h
libcwSRC += src/libcw/cwString.cpp src/libcw/cwMtx.cpp src/libcw/cwVariant.cpp
libcwHDR += src/libcw/cwString.h src/libcw/cwMath.h src/libcw/cwVectOps.h src/libcw/cwMtx.h src/libcw/cwVariant.h
libcwSRC += src/libcw/cwString.cpp src/libcw/cwMath.cpp src/libcw/cwMtx.cpp src/libcw/cwVariant.cpp
libcwHDR += src/libcw/cwFileSys.h src/libcw/cwText.h src/libcw/cwFile.h src/libcw/cwTime.h src/libcw/cwLex.h src/libcw/cwNumericConvert.h
libcwSRC += src/libcw/cwFileSys.cpp src/libcw/cwText.cpp src/libcw/cwFile.cpp src/libcw/cwTime.cpp src/libcw/cwLex.cpp

9
cwMath.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "cwCommon.h"
#include "cwLog.h"
#include "cwCommonImpl.h"
#include "cwMath.h"
unsigned cw::math::randUInt( unsigned minVal, unsigned maxVal )
{
return std::max(minVal,std::min(maxVal,minVal + (unsigned)round(((maxVal - minVal) * rand())/RAND_MAX)));
}

14
cwMath.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef cwMath_h
#define cwMath_h
namespace cw
{
namespace math
{
unsigned randUInt(unsigned minVal, unsigned maxVal );
}
}
#endif