Ruby/Справочник/Integer: различия между версиями

Содержимое удалено Содержимое добавлено
Строка 87:
<source lang=ruby>num.gcdlcm(other)</source>
----
Возвращает [[w:НОД|НОД]] и [[w:НОК|НОК]] (см. [[#Integer#gcd|gcd]] и [[#Integer#lcm|lcm]]) двух чисел (''num'' и ''other''). Этот метод особенно эффективен, когда необходимо посчитать НОД и НОК одновременно.
Returns the GCD <i>and</i> the LCM (see #gcd and #lcm) of the two arguments (<tt>self</tt> and <tt>other</tt>). This is more efficient than calculating them separately.
<source lang=ruby>6.gcdlcm 9 #-> [3, 18]</source>
{{Похожие методы|Integer|gcd|lcm}}
 
===Integer#integer?===
----