fixnum Questions

8

Solved

I want find the length of a Fixnum, num, without converting it into a String. In other words, how many digits are in num without calling the .to_s() method: num.to_s.length
Wellborn asked 22/12, 2012 at 18:44

7

Solved

Is there a method in ruby to turn fixnum like 74239 into an array like [7,4,2,3,9]?
Beauty asked 16/10, 2012 at 5:22

6

Solved

I need to be able to determine a systems maximum integer in Ruby. Anybody know how, or if it's possible?
Gapes asked 11/2, 2009 at 7:3

4

Solved

I recently decided I wanted to list all the users in my Ruby On Rails application - since I couldn't figure out how to list them any other way, I decided to use partials. I have the following on my...
Diggins asked 9/2, 2011 at 21:13

2

Solved

For example, if I want 987 to equal "900".
Creolacreole asked 20/7, 2017 at 23:47

2

Solved

I am trying to answer the following question from Chris Pine's "Learn to Program" book: Leap years. Write a program that asks for a starting year and an ending year and then puts all the leap ye...
Koester asked 3/12, 2013 at 16:34

3

Solved

I'm currently trying to divide counts["email"] a hash containing the number 82,000 by a variable total which contains the value 1.3 million. When I run puts counts["email"]/total I get 0. Why can...
Canute asked 25/6, 2012 at 21:23

2

Solved

I'm looking for the standard way to represent negative infinity in Lisp. Is there a symblic value which is recognised by Lisp's arithmetic functions as less than all other numbers? Specifically, I...
Peculate asked 12/12, 2011 at 13:31
1

© 2022 - 2024 — McMap. All rights reserved.