Examples of convertToFloat()


Examples of org.jruby.runtime.builtin.IRubyObject.convertToFloat()

            IRubyObject last  = range.last();
           
            boolean returnFloat = first instanceof RubyFloat || last instanceof RubyFloat;
            if (returnFloat) {
                first = first.convertToFloat();
                last  = last.convertToFloat();
            }

            if (range.include_p19(context, last).isTrue() && (!returnFloat)) {
                last = last.callMethod(context, "+", runtime.newFixnum(1));
            }
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToFloat()

            String hours = offsetMatcher.group(2);
            String minutes = offsetMatcher.group(3);
            dtz = getTimeZoneFromHHMM(runtime, "", !sign.equals("-"), hours, minutes);
        } else {
            IRubyObject numericOffset = numExact(runtime, utcOffset);
            int newOffset = (int)Math.round(numericOffset.convertToFloat().getDoubleValue() * 1000);
            dtz = getTimeZoneWithOffset(runtime, "", newOffset);
        }

        runtime.getTimezoneCache().put(strOffset, dtz);
        return dtz;
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToFloat()

            Ruby runtime = context.getRuntime();
            if (!options.isNil() && options.respondsTo("[]")) {
                IRubyObject rInitialCapacity = options.callMethod(context, "[]", runtime.newSymbol("initial_capacity"));
                IRubyObject rLoadFactor      = options.callMethod(context, "[]", runtime.newSymbol("load_factor"));
                int initialCapacity = !rInitialCapacity.isNil() ? RubyNumeric.num2int(rInitialCapacity.convertToInteger()) : DEFAULT_INITIAL_CAPACITY;
                float loadFactor    = !rLoadFactor.isNil() ?      (float)RubyNumeric.num2dbl(rLoadFactor.convertToFloat()) : DEFAULT_LOAD_FACTOR;
                return newCHM(initialCapacity, loadFactor);
            } else {
                return newCHM();
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.