5.30. Conclusion

In this chapter, we have looked at various representations for numbers, including integers (in different bases) and floats. We’ve seen problems with floating-point math, and how working with rational values can help avoid these problems. We’ve looked at implicit and explicit numeric conversion and coercion.

We’ve seen numerous ways to manipulate numbers, vectors, and matrices. We’ve had a good overview of most of the number-related standard libraries, in particular the mathn library.

Let’s move on. In the next chapter, we discuss two very Rubyish data types: symbols and ranges.

Get The Ruby Way: Solutions and Techniques in Ruby Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.