History

updated Math.INFINITY to use limits library

Ge Wang committed 3 years ago

Commit 65638c41 parent 977dd9e1 file · +4 −2Browse files

Showing the changes to src (1 of 1 file). Show all

Unified · Split

src/core/ulib_math.cpp+4−2
@@ -35,11 +35,11 @@ · 34 unmodified lines
3535 #include "chuck_compile.h"
3636 #include "util_math.h"
3737
38−#include <limits.h>
3938 #include <float.h>
4039 #include <stdlib.h>
4140 #include <time.h>
4241
42+#include <limits>
4343 #include <vector> // 1.5.0.0 (ge) | added
4444
4545
@@ -470,7 +470,9 @@ DLL_QUERY libmath_query( Chuck_DL_Query * QUERY ) · 424 unmodified lines
470470 QUERY->doc_var( QUERY, "Largest representable integer value." );
471471
472472 // infinity, using function to avoid potential "smart" compiler warning
473− g_inf = 1.0 / fzero();
473+ // g_inf = 1.0 / fzero();
474+ // 1.5.0.0 (ge) | updated to use limits
475+ g_inf = std::numeric_limits<t_CKFLOAT>::infinity();
474476 QUERY->add_svar( QUERY, "float", "INFINITY", TRUE, &g_inf );
475477 QUERY->doc_var( QUERY, "Like, infinity." );
476478

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t