search for: dbl_max

Displaying 8 results from an estimated 8 matches for "dbl_max".

2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...orming the calculation is: static Rboolean rsum(double *x, R_xlen_t n, double *value, Rboolean narm) { LDOUBLE s = 0.0; Rboolean updated = FALSE; for (R_xlen_t i = 0; i < n; i++) { if (!narm || !ISNAN(x[i])) { if(!updated) updated = TRUE; s += x[i]; } } if(s > DBL_MAX) *value = R_PosInf; else if (s < -DBL_MAX) *value = R_NegInf; else *value = (double) s; return updated; } In other words, when na.rm=FALSE, that inner for loop: for (R_xlen_t i = 0; i < n; i++) { if (!narm || !ISNAN(x[i])) { if(!updated) updated = TRUE; s += x[i];...
2023 Mar 01
1
[libnbd PATCH 6/6] common/include: Fix MIN and MAX macros so they can be nested [finish port]
...anged, 14 insertions(+) diff --git a/common/include/test-minmax.c b/common/include/test-minmax.c index 285f8074e503..095c91491acc 100644 --- a/common/include/test-minmax.c +++ b/common/include/test-minmax.c @@ -154,5 +154,19 @@ main (void) SIGNED_TEST (f, -FLT_MAX, FLT_MAX); SIGNED_TEST (d, -DBL_MAX, DBL_MAX); + /* Test that MIN and MAX can be nested. This is really a compile + * test, but we do check the answer. + */ + assert (MIN (MIN (1, 2), 3) == 1); + assert (MAX (MIN (1, 2), 3) == 3); + assert (MIN (MAX (1, 2), 3) == 2); + assert (MAX (MAX (1, 4), 3) == 4); + assert (MIN (3,...
2015 Jun 01
0
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...ouble *x, R_xlen_t n, double *value, Rboolean narm) > { > LDOUBLE s = 0.0; > Rboolean updated = FALSE; > for (R_xlen_t i = 0; i < n; i++) { > if (!narm || !ISNAN(x[i])) { > if(!updated) updated = TRUE; > s += x[i]; > } > } > if(s > DBL_MAX) *value = R_PosInf; > else if (s < -DBL_MAX) *value = R_NegInf; > else *value = (double) s; > return updated; > } > > In other words, when na.rm=FALSE, that inner for loop: > > for (R_xlen_t i = 0; i < n; i++) { > if (!narm || !ISNAN(x[i])) { >...
2023 Mar 01
6
[libnbd PATCH 0/6] common: catch up with nbdkit
If we compare the "common" subdirectory between nbdkit @ 6b4178d0fdfe ("ci: Temporarily disable perl in MacOS", 2023-02-27) and libnbd @ d05cd8f384a7 ("Version 1.15.11.", 2023-02-28), we find differences. We can categorize these differences along two (orthogonal) axes: - Intentional or unintentional. Intentional differences are for example when one of the libnbd
2008 Jul 02
2
spss long labels
...====== --- src/var.h.in (revision 5168) +++ src/var.h.in (working copy) @@ -41,6 +41,10 @@ #error MAX_SHORT_STRING must be less than 8. #endif +/* VAR_NAME_LEN: the length of a variable. + * SPSS supports names of 64 long + */ +#define VAR_NAME_LEN 64 /* Special values. */ #define SYSMIS (-DBL_MAX) #define LOWEST second_lowest_double_val() @@ -228,7 +232,7 @@ /* MODIFY VARS private data. */ struct modify_vars_proc { - char new_name[9]; /* Variable's new name. */ + char new_name[VAR_NAME_LEN +1]; /* Variable's new name. */ int drop_this_var; /* 0=keep this var...
2000 Sep 15
3
R on HP-UX, again: modreg.sl fails, 1 arith test fails
I want to report the progress of my attempts to get R running on HP-UX with gcc: Firstly, I could work around the PIC problem by leaving out all the lib stuff (I rebuilt gcc with --enable-share, but this (alone) did not help), e.g. the line gcc -shared -fPIC -o ctest.sl ansari.o fexact.o kendall.o ks.o prho.o swilk.o -L/usr/local/lib -lg2c -lm -L/lib/pa1.1 -L/usr/lib/pa1.1 -u main
2019 Jan 05
1
unsorted - suggestion for performance improvement and ALTREP support for POSIXct
I believe the performance of isUnsorted() in sort.c could be improved by calling REAL() once (outside of the for loop), rather than calling it twice inside the loop. As an aside, it is implemented in the faster way in doSort() (sort.c line 401). The example below shows the performance improvement for a vectors of double of moving REAL() outside the for loop. # example as implemented in
2003 Apr 24
2
R-1.7.0 build feedback: NetBSD 1.6 (PR#2837)
R-1.7.0 built on NetBSD 1.6, but the validation test suite failed: Machinetype: Intel Pentium III (600 MHz); NetBSD 1.6 (GENERIC) Remote gcc version: gcc (GCC) 3.2.2 Remote g++ version: g++ (GCC) 3.2.2 Configure environment: CC=gcc CXX=g++ LDFLAGS=-Wl,-rpath,/usr/local/lib make[5]: Entering directory `/local/build/R-1.7.0/src/library' >>> Building/Updating