[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

NaN Error

Tim Pease

4/16/2007 8:58:00 PM

> ruby --version
ruby 1.8.5 (2006-12-25 patchlevel 12) [sparc-solaris2.8]

> irb
>> Float::MAX
=> 1.79769313486232e+308
>> 1.0e+300
=> 1.0e300
>> 1.0e+301
=> NaN
>> 1.0e+308
=> NaN
>> 1.0e+309
=> NaN
>> 1.0e+700
=> 8.55180271847103e+116
>>


And on my Windows XP machine ...

> ruby --version
ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-cygwin]

> irb
>> Float::MAX
=> 1.79769313486232e308
>> 1.0e+300
=> 1.0e300
>> 1.0e+301
=> 1.0e301
>> 1.0e+308
=> 1.0e308
>> 1.0e+309
=> Infinity
>>


Any idea why the Solaris machine is fairly messed up for large float values??

Blessings,
TwP

2 Answers

poison tooth

4/17/2007 6:26:00 AM

0

Im just learning ruby and im stuck the guide im using says

"Your first program
Congratulations! Now that you have made it this far, you are ready to
start writing programs.
Hello World
Grab a text editor and type in the following:

puts "Hello World"

Save the file as hello.rb and run it by typing
ruby hello.rb"

i've tried that more than once and it says the out is:

"irb(main):001:0> ruby hello.rb
NameError: undefined local variable or method `hello' for main:Object
from (irb):1
irb(main):002:0> "

the guide never said what word processor should i use
i tried TextEdit.app but it fussed about the .rb
so i used Microsoft word and this is what it does...

Any tips?

On 4/16/07, Tim Pease <tim.pease@gmail.com> wrote:
> > ruby --version
> ruby 1.8.5 (2006-12-25 patchlevel 12) [sparc-solaris2.8]
>
> > irb
> >> Float::MAX
> => 1.79769313486232e+308
> >> 1.0e+300
> => 1.0e300
> >> 1.0e+301
> => NaN
> >> 1.0e+308
> => NaN
> >> 1.0e+309
> => NaN
> >> 1.0e+700
> => 8.55180271847103e+116
> >>
>
>
> And on my Windows XP machine ...
>
> > ruby --version
> ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-cygwin]
>
> > irb
> >> Float::MAX
> => 1.79769313486232e308
> >> 1.0e+300
> => 1.0e300
> >> 1.0e+301
> => 1.0e301
> >> 1.0e+308
> => 1.0e308
> >> 1.0e+309
> => Infinity
> >>
>
>
> Any idea why the Solaris machine is fairly messed up for large float values??
>
> Blessings,
> TwP
>
>


--
fish can't fly but birds can
birds can't swim but fish can

Robert Dober

4/17/2007 7:19:00 AM

0

On 4/17/07, poison tooth <fixxie.wits@gmail.com> wrote:
> Im just learning ruby and im stuck the guide im using says
>
> "Your first program
> Congratulations! Now that you have made it this far, you are ready to
> start writing programs.
> Hello World
> Grab a text editor and type in the following:
>
> puts "Hello World"
>
> Save the file as hello.rb and run it by typing
> ruby hello.rb"
>
> i've tried that more than once and it says the out is:
>
> "irb(main):001:0> ruby hello.rb
> NameError: undefined local variable or method `hello' for main:Object
> from (irb):1
> irb(main):002:0> "
>
> the guide never said what word processor should i use
> i tried TextEdit.app but it fussed about the .rb
> so i used Microsoft word and this is what it does...
>
> Any tips?
Welcome to ruby.
You just hijacked a thread of someone else, you are probably not aware of this.
Can you please resend your question to the mailing list, not in reply
to this thread.
And for future reference, please do not top post.
Thx
Robert
>
> On 4/16/07, Tim Pease <tim.pease@gmail.com> wrote:
> > > ruby --version
> > ruby 1.8.5 (2006-12-25 patchlevel 12) [sparc-solaris2.8]
> >
> > > irb
> > >> Float::MAX
> > => 1.79769313486232e+308
> > >> 1.0e+300
> > => 1.0e300
> > >> 1.0e+301
> > => NaN
> > >> 1.0e+308
> > => NaN
> > >> 1.0e+309
> > => NaN
> > >> 1.0e+700
> > => 8.55180271847103e+116
> > >>
> >
> >
> > And on my Windows XP machine ...
> >
> > > ruby --version
> > ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-cygwin]
> >
> > > irb
> > >> Float::MAX
> > => 1.79769313486232e308
> > >> 1.0e+300
> > => 1.0e300
> > >> 1.0e+301
> > => 1.0e301
> > >> 1.0e+308
> > => 1.0e308
> > >> 1.0e+309
> > => Infinity
> > >>
> >
> >
> > Any idea why the Solaris machine is fairly messed up for large float values??
> >
> > Blessings,
> > TwP
> >
> >
>
>
> --
> fish can't fly but birds can
> birds can't swim but fish can
>
>


--
You see things; and you say Why?
But I dream things that never were; and I say Why not?
-- George Bernard Shaw