Lines Matching refs:ndigits
11706 $def(self, '$ceil', function $$ceil(ndigits) { argument
11710 if (ndigits == null) ndigits = 0;
11711 return self.$to_f().$ceil(ndigits);
11743 $def(self, '$floor', function $$floor(ndigits) { argument
11747 if (ndigits == null) ndigits = 0;
11748 return self.$to_f().$floor(ndigits);
11980 $def(self, '$truncate', function $$truncate(ndigits) { argument
11984 if (ndigits == null) ndigits = 0;
11985 return self.$to_f().$truncate(ndigits);
16538 $def(self, '$ceil', function $$ceil(ndigits) { argument
16542 if (ndigits == null) ndigits = 0;
16546 if (f % 1 === 0 && ndigits >= 0) {
16550 var factor = Math.pow(10, ndigits),
16616 $def(self, '$floor', function $$floor(ndigits) { argument
16620 if (ndigits == null) ndigits = 0;
16624 if (f % 1 === 0 && ndigits >= 0) {
16628 var factor = Math.pow(10, ndigits),
16826 $def(self, '$round', function $$round(ndigits) { argument
16830 if ($truthy(ndigits == null)) {
16832 } if (($eqeqeq($$$('Float'), ndigits) && ($truthy(ndigits['$infinite?']())))) {
16834 } ndigits = $Opal['$coerce_to!'](ndigits, $$$('Integer'), "to_int");
16835 if ($truthy($rb_lt(ndigits, $$$($$$('Integer'), 'MIN')))) {
16837 } if ($truthy(ndigits >= 0)) {
16839 } ndigits = ndigits['$-@']();
16841 if (0.415241 * ndigits - 0.125 > self.$size()) {
16845 var f = Math.pow(10, ndigits),
16851 if (($truthy(self['$nan?']()) && ($truthy(ndigits == null)))) {
16853 } ndigits = $Opal['$coerce_to!'](ndigits || 0, $$$('Integer'), "to_int");
16854 if ($truthy($rb_le(ndigits, 0))) {
16860 } else if ($eqeq(ndigits, 0)) {
16865 …if ($truthy($rb_ge(ndigits, $rb_minus($rb_plus($$$($$$('Float'), 'DIG'), 2), ($truthy($rb_gt(exp, …
16867 …} if ($truthy($rb_lt(ndigits, ($truthy($rb_gt(exp, 0)) ? ($rb_plus($rb_divide(exp, 3), 1)) …
16869 …} return Math.round(self * Math.pow(10, ndigits)) / Math.pow(10, ndigits); } }, -1);
16920 $def(self, '$truncate', function $$truncate(ndigits) { argument
16924 if (ndigits == null) ndigits = 0;
16928 if (f % 1 === 0 && ndigits >= 0) {
16932 var factor = Math.pow(10, ndigits),