mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use std::numbers::pi instead of hard-coded value
This commit is contained in:
parent
66aefc6a54
commit
aa3940f16d
2 changed files with 4 additions and 3 deletions
|
@ -9,13 +9,14 @@
|
|||
|
||||
%%{ // C++ segment
|
||||
#include <sys/stat.h>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <numbers>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "zeek/digest.h"
|
||||
|
@ -4222,7 +4223,7 @@ function blocking_lookup_hostname%(host: string%) : addr_set
|
|||
## .. zeek:see:: haversine_distance_ip
|
||||
function haversine_distance%(lat1: double, long1: double, lat2: double, long2: double%): double
|
||||
%{
|
||||
const double PI = 3.14159;
|
||||
const double PI = std::numbers::pi;
|
||||
const double RADIUS = 3958.8; // Earth's radius in miles.
|
||||
|
||||
double s1 = sin((lat2 - lat1) * PI/360);
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
5.8481e+03
|
||||
1.9193e-02
|
||||
1.5136e-02
|
||||
9.2419e-01
|
||||
9.0763e-01
|
||||
1.2437e+04
|
||||
1.2437e+04
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue