Skip to content

Commit 60fcac7

Browse files
committed
Fix typecast
1 parent 3d1a43e commit 60fcac7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
GENERATOR = Ninja
44
CONFIG = Release
55
PLATFORM = -DCMAKE_OSX_ARCHITECTURES=arm64
6-
OPTIONS = -DLOGGING=ON -DCHRONO=ON -DWARNINGS=ON
6+
OPTIONS = -DLOGGING=ON -DCHRONO=ON -DWARNINGS=OFF
77

88
PLUGIN = Robotone
99
INPUT = .

src/Robocode/Math.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ inline double radian_to_hertz(const double samplerate)
3131
}
3232

3333
// https://newt.phys.unsw.edu.au/jw/notes.html
34-
inline double midi_to_hertz(const double midi, const double concertpitch)
34+
template<typename T>
35+
inline double midi_to_hertz(const T midi, const double concertpitch)
3536
{
36-
return std::pow(2, (midi - 69) / 12) * concertpitch;
37+
return std::pow(2, (static_cast<double>(midi) - 69) / 12) * concertpitch;
3738
}

0 commit comments

Comments
 (0)