Lines Matching refs:ndigits

11715     $def(self, '$ceil', function $$ceil(ndigits) {
11719 if (ndigits == null) ndigits = 0;
11720 return self.$to_f().$ceil(ndigits);
11752 $def(self, '$floor', function $$floor(ndigits) {
11756 if (ndigits == null) ndigits = 0;
11757 return self.$to_f().$floor(ndigits);
11989 $def(self, '$truncate', function $$truncate(ndigits) {
11993 if (ndigits == null) ndigits = 0;
11994 return self.$to_f().$truncate(ndigits);
16547 $def(self, '$ceil', function $$ceil(ndigits) {
16551 if (ndigits == null) ndigits = 0;
16555 if (f % 1 === 0 && ndigits >= 0) {
16559 var factor = Math.pow(10, ndigits),
16625 $def(self, '$floor', function $$floor(ndigits) {
16629 if (ndigits == null) ndigits = 0;
16633 if (f % 1 === 0 && ndigits >= 0) {
16637 var factor = Math.pow(10, ndigits),
16835 $def(self, '$round', function $$round(ndigits) {
16839 if ($truthy(ndigits == null)) {
16841 } if (($eqeqeq($$$('Float'), ndigits) && ($truthy(ndigits['$infinite?']())))) {
16843 } ndigits = $Opal['$coerce_to!'](ndigits, $$$('Integer'), "to_int");
16844 if ($truthy($rb_lt(ndigits, $$$($$$('Integer'), 'MIN')))) {
16846 } if ($truthy(ndigits >= 0)) {
16848 } ndigits = ndigits['$-@']();
16850 if (0.415241 * ndigits - 0.125 > self.$size()) {
16854 var f = Math.pow(10, ndigits),
16860 if (($truthy(self['$nan?']()) && ($truthy(ndigits == null)))) {
16862 } ndigits = $Opal['$coerce_to!'](ndigits || 0, $$$('Integer'), "to_int");
16863 if ($truthy($rb_le(ndigits, 0))) {
16869 } else if ($eqeq(ndigits, 0)) {
16874 …if ($truthy($rb_ge(ndigits, $rb_minus($rb_plus($$$($$$('Float'), 'DIG'), 2), ($truthy($rb_gt(exp, …
16876 …} if ($truthy($rb_lt(ndigits, ($truthy($rb_gt(exp, 0)) ? ($rb_plus($rb_divide(exp, 3), 1)) …
16878 …} return Math.round(self * Math.pow(10, ndigits)) / Math.pow(10, ndigits); } }, -1);
16929 $def(self, '$truncate', function $$truncate(ndigits) {
16933 if (ndigits == null) ndigits = 0;
16937 if (f % 1 === 0 && ndigits >= 0) {
16941 var factor = Math.pow(10, ndigits),