Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf92b41a

Browse files
committed
Use cmath and std::isnan instead of C's isnan macro
1 parent883c216 commitf92b41a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/Agent.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include"../inst/include/Agent.h"
22
#include"../inst/include/Simulation.h"
3-
#include<math.h>
3+
#include<cmath>
44

55
usingnamespaceRcpp;
66

@@ -91,7 +91,7 @@ XP<Agent> newAgent(Nullable<List> state, NumericVector death_time = NA_REAL)
9191
{
9292
XP<Agent> a = (std::make_shared<Agent>(state));
9393
double d = as<double>(death_time);
94-
if (!isnan(d)) a->setDeathTime(d);
94+
if (!std::isnan(d)) a->setDeathTime(d);
9595
return a;
9696
}
9797

‎src/Simulation.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include"../inst/include/Simulation.h"
2-
#include<math.h>
2+
#include<cmath>
33

44
usingnamespaceRcpp;
55

@@ -60,7 +60,7 @@ List Simulation::resume(const NumericVector &time)
6060

6161
voidSimulation::stateChanged(Agent &agent,const State &from)
6262
{
63-
if (!isnan(_current_time)) {
63+
if (!std::isnan(_current_time)) {
6464
for (auto c : _loggers)
6565
c->log(agent, from);
6666
for (auto r : _rules) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp