From: "M. Edward (Ed) Borasky" Date: 2008-07-02T22:28:16+09:00 Subject: Re: Ruby Exponents Tony Dermont wrote: > Hi, > > I'm trying to calculate using exponential operator **. However, I get a > crash with the following message > > wrong argument type Float (expected Fixnum) > > The values I am using are 0.713 ** 0.5555555 => THIS CRASHES > > But when I try this on a ruby command prompt, it works fine. Is there a > way I can calculate using a float number as an exponent? > > Thanks. > > Tony znmeb@DreamScape ~ $ echo 'puts 0.713 ** 0.5555555' > script.rb znmeb@DreamScape ~ $ ruby script.rb 0.828672792977234 znmeb@DreamScape ~ $ ruby -e ' puts 0.713 ** 0.5555555' 0.828672792977234 znmeb@DreamScape ~ $ irb irb(main):001:0> 0.713 ** 0.5555555 => 0.828672792977234 irb(main):002:0> quit znmeb@DreamScape ~ $ ruby --version ruby 1.8.6 (2008-06-20 patchlevel 230) [x86_64-linux] znmeb@DreamScape ~ $ So there's nothing wrong with your code. What version of Ruby do you have? Maybe it needs to be upgraded or re-installed.