[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Why is there a seperate Math class?

Yukihiro Matsumoto

1/9/2007 2:44:00 AM

Hi,

In message "Re: Why is there a seperate Math class?"
on Tue, 9 Jan 2007 11:21:21 +0900, Daniel Finnie <danfinnie@optonline.net> writes:

|I have to think this is the first time I've ever really disagreed with
|matz and don't really understand his logic.

Probably it's highly influenced by the languages we speak.
Unfortunately, English is not the only language on Earth.

|If I were to ask someone for the length of the word apples, I would say
|"What is the length of apples?" In ruby, this would be "apples".length.

I would say "apples no nagasa wa?" in Japanese (nagasa = length).

|If I were to ask someone for the sine of, say, 90, I would say "What is
|the sine of 90?" In ruby, this would be Math.sin(90) even though the
|structure of the sentence is the same as for "apples" above.

I would say "sin(90) wa?". See? It's different. ;-)

Besides that, and far more importantly, Ruby honors UNIX math library
(libm). All functions in Math module are found in libm.

matz.