From: Brian Wisti Date: 2002-12-27T15:42:30+09:00 Subject: Re: 1210 / 100 = 12? what? Hi Tom, Integer division is one of those areas which is strangely controversial. To some people, POLS is "integer divided by integer results in an integer". To others, it is "a number divided by another number results in the integer or decimal value to represent the precise quotient, converting between numeric types if necessary". If you can't tell by my stumbling over the phrasing of this problem, I belong in the first camp. For me in this case, POLS is sticking to the initial types unless explicitly stating or absolutely required otherwise. This behavior is similar to that of other languages, so somebody coming in from one of those other languages would be surprised if "1210/10" did not return 12! -Brian W On Thu, 2002-12-26 at 22:27, Tom Sawyer wrote: > no i didn't realize that. i thought ruby would automatically change it to a > float if need be, i.e. with divison, just as it changes to Bignum if need be. > > honestly i don't like it. now i have to go around adding .0's all over the > place to make sure the math comes out right. and in some places i have to do > things like multiple by 1.0 b/c certain values come from cgi script variables > i have no control over. > > well, it will suffice now that i know, but to me it is definitely not POLS. > > -tom -- Brian Wisti brian@coolnamehere.com http://coolnamehere.com/