Project

General

Profile

Actions

Bug #760

closed

Net::FTP does not work when "mathn" is loaded.

Added by Lavir_the_Whiolet (Lavir the Whiolet) about 16 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:19979]

Description

=begin
Net::FTP starts raising exceptions when "mathn" is loaded. The problem is in Net::FTP#sendport(): when "mathn" is required, "port / 256" starts resulting in Rational rather than in Integer. And "sprintf("%d", port)" results in incorrect "number/256" string (as Rational#to_s() does) rather than just "number".
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) about 16 years ago

  • Status changed from Open to Closed

=begin
It's already fixed in 1.8.7.
=end

Actions #2

Updated by trans (Thomas Sawyer) about 16 years ago

=begin

On Nov 17, 11:12 pm, Lavir the Whiolet wrote:

Bug #760: Net::FTP does not work when "mathn" is loaded.http://redmine.ruby-lang.org/issues/show/760

Author: Lavir the Whiolet
Status: Open, Priority: Normal

Net::FTP starts raising exceptions when "mathn" is loaded. The problem is in Net::FTP#sendport(): when "mathn" is required, "port / 256" starts resulting in Rational rather than in Integer. And "sprintf("%d", port)" results in incorrect "number/256" string (as Rational#to_s() does) rather than just "number".

----------------------------------------http://redmine.ruby-lang.org

This is the first I ever heard of mathn.rb, so I looked it up and,
well I don't exactly get it.

What I see that makes sense as a separate library is Prime. And I'll
tell you what. I would never have thought to look in the totally
undocumented mathn.rb for such a thing. "prime.rb" yes, "mathn.rb"
no.

On top of this, a few of the (whole 8) extension methods, do not seem
to need Prime. Could they not just as well be in the original classes
(eg. Math#sqrt)? And are any of the other extensions (eg. Ratonal#**)
overriding the original methods in an incompatible way? If so, that
stinks. Use methods names not already used!

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0