HiddenVariable has it right, but Mikhail is right too.
Mikhail is saying, suppose you only know the length of the slope (not the horizontal run, as HiddenVariable uses) and the rise. Using Wikipedia's diagram from their article on grades, you know the slope length l but not the run d (as well as the rise h).

To precisely compute the grade from that, it's not as simple as
grade = 100 * rise / run
You need a little trig.
Mikhail made a few typos that make things a bit confusing, but I think his formula
grade = 100 * tan( arcsin( rise / slopelength ) )
is right. Using the notation from the diagram, the grade g is
g = 100 tan( arcsin( h / l ) ) = 100 h / d
Of course, the slope length l (as measured by counting the revolutions of a bike wheel) will usually be close to the run d (as measured on a map), except on very steep terrain. And how often do you know the slope length but not the run?