X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fexpressions%2Foperations.def;h=471fa1d30d331c4cb6e924b6c6822dcbe4570bde;hb=52c296b2b56751899e9d9fb8772135a5073d7168;hp=37af54a9118abf8755fd0205cdaebdbe20021f46;hpb=0db42c2d683822e1252f17c2c81252a79e618d9c;p=pspp diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index 37af54a911..471fa1d30d 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -1,7 +1,7 @@ // -*- c -*- // // PSPP - a program for statistical analysis. -// Copyright (C) 2005, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2009, 2010, 2011, 2012, 2015 Free Software Foundation, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -84,7 +84,9 @@ function LG10(x) = check_errno (log10 (x)); function LN (x) = check_errno (log (x)); function LNGAMMA (x >= 0) = gsl_sf_lngamma (x); function MOD10 (x) = fmod (x, 10); -function RND (x) = x >= 0. ? floor (x + .5) : -floor (-x + .5); +function RND (x) = round_nearest (x, 1, 0); +function RND (x, mult != 0) = round_nearest (x, mult, 0); +function RND (x, mult != 0, fuzzbits >= 0) = round_nearest (x, mult, fuzzbits); function SIN (x) = sin (x); function SQRT (x >= 0) = sqrt (x); function TAN (x) = check_errno (tan (x)); @@ -415,7 +417,7 @@ function RINDEX (string haystack, string needle) function RINDEX (string haystack, string needles, needle_len_d) { - if (needle_len_d <= INT_MIN || needle_len_d >= INT_MAX + if (needle_len_d <= 0 || needle_len_d >= INT_MAX || (int) needle_len_d != needle_len_d || needles.length == 0) return SYSMIS;