LoginSignup
4
0

More than 5 years have passed since last update.

[問題] Ruby で (n.to_s < m.to_s) && (n + m == n / m) が真となるのは?

Posted at

暇つぶし問題です。

Ruby で (n.to_s < m.to_s) && (n + m == n / m) が真となるのはどんなときか。

ただし,nm はローカル変数であり,Ruby の標準添付ライブラリーのクラス(もしくは組込みクラス)のインスタンスが代入されていて,メソッドの再定義はされていないとする。

答えはここをめくってね
答えの例:n, m = Pathname("a"), Pathname("b") のとき。

4
0
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0