Rails Noob, Math or Array Issue?

Let's say that below is the math for figuring out a unit in a popular
diet program:

    @fiber = Array.new(@food.fiber, 4)
    @points = (@food.calories / 50) + (@food.fat / 12) - (@fiber.min /

And that for personal use, I'm creating a system to keep track of
these units on a daily basis and I'm simply rendering @points in the
following manner in my view:

   <p><b>Points:</b> <%= @points %></p>

But when @points equals 0, I get the nasty message:

NoMethodError in FoodsController#show

You have a nil object when you didn't expect it!
The error occurred while evaluating nil./

What would one do to make it OK to have a 0 instead of causing it to
evaluate nil?

I goofed up...when the minimum of @fiber = 0, I get the nasty
message...not when @points = 0. I apologize.

Finally figured it out on my own with some modifications...

  def show
    @food = Food.find(params[:id])
    @fiber = Array.new(@food.fiber.to_f, 4)
    @points = (@food.calories.to_f / 50) + (@food.fat.to_f / 12) -
((@fiber.min.to_f) / 5)

<p><b>Points:</b> <%= @points.round %></p>

Seems to produce the results I want...any better way would be welcome.

What I need is something that returns the minimum of food.fiber or 4,
whichever is lower. I appreciate your help--I'm just a programming
idiot to begin with and even moreso at Ruby/Rails.