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
35#include "chuck_compile.h"35#include "chuck_compile.h"
36#include "util_math.h"36#include "util_math.h"
37 37
38#include <limits.h>
39#include <float.h>38#include <float.h>
40#include <stdlib.h>39#include <stdlib.h>
41#include <time.h>40#include <time.h>
42 41
42#include <limits>
43#include <vector> // 1.5.0.0 (ge) | added43#include <vector> // 1.5.0.0 (ge) | added
44 44
45 45
@@ -470,7 +470,9 @@ DLL_QUERY libmath_query( Chuck_DL_Query * QUERY ) · 424 unmodified lines
470 QUERY->doc_var( QUERY, "Largest representable integer value." );470 QUERY->doc_var( QUERY, "Largest representable integer value." );
471 471
472 // infinity, using function to avoid potential "smart" compiler warning472 // 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();
474 QUERY->add_svar( QUERY, "float", "INFINITY", TRUE, &g_inf );476 QUERY->add_svar( QUERY, "float", "INFINITY", TRUE, &g_inf );
475 QUERY->doc_var( QUERY, "Like, infinity." );477 QUERY->doc_var( QUERY, "Like, infinity." );
476 478

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