回文数(かいぶんすう、Palindromic number)とは、なんらかの位取り記数法(N進法)で数を記した際、たとえば十進法において14641のように逆から数字を並べても同じ数になる数である。同様の言葉遊びである回文にちなむ名前である。具体的には 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191,…(オンライン整数列大辞典の数列 A002113) である。 回文数は、趣味の数学の分野ではよく研究の対象になる。代表的なものとしては、ある性質を持った回文数を求めることがある。以下のようなものがよく知られている。 回文素数 2, 3, 5, 7, 11, 101, 131, 151, … 回文平方数[1] 0, 1
has value 0/2 + 0/4 + 1/8. These two fractions have identical values, the only real difference being that the first is written in base 10 fractional notation, and the second in base 2. Unfortunately, most decimal fractions cannot be represented exactly as binary fractions. A consequence is that, in general, the decimal floating-point numbers you enter are only approximated by the binary floating-p
function isInteger(x) { return Math.round(x) === x; } > isInteger(1) true > isInteger(0) true > isInteger(1.111) false > isInteger("1") false > isInteger("") false > isInteger(null) false > isInteger(NaN) false > isInteger(undefined) false Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read back useful informationYou can use dark th
In Ruby, there are many methods available which help us to modify a float or integer value. Ruby 2.3.x In the previous versions of Ruby, we could use methods such as floor, ceil and truncate in following ways. 1 25.54.floor #=> 5 35.54.ceil #=> 6 45.54.truncate #=> 5 5 Copy Providing an argument to these methods would result in ArgumentError exception. Ruby 2.4 Ruby community decided to come up wi
Ruby uses Fixnum class for representing small numbers and Bignum class for big numbers. 1# Before Ruby 2.4 2 31.class #=> Fixnum 4(2 ** 62).class #=> BignumCopy In general routine work we don't have to worry about whether the number we are dealing with is Bignum or Fixnum. It's just an implementation detail. Interestingly, Ruby also has Integer class which is superclass for Fixnum and Bignum. Star
Abstract Implemented a way to optimize ruby's executions and to revert them. The strategy is restricted so that any VM states like program counter(s) would not be affected by the modifications. This restriction makes deoptimize much lightweight. Experiments show optimizations on this mechanism speeds up micro benchmarks, yet has no significant overheads for pitfall-ish activities, like eval. Intro
The first preview version of Ruby 2.4 was released a few days ago. This particular release includes a bunch of new features. Moreover, it introduces some fixes and changes that are not entirely backward compatible. Thus, we need to pay close attention to these differences in this new version of Ruby. In this post, we’ll focus on some remarkable changes in behavior, so as to better understand how o
Posted by naruse on 20 Jun 2016 We are pleased to announce the release of Ruby 2.4.0-preview1. Ruby 2.4.0-preview1 is the first preview of Ruby 2.4.0. This preview1 is released earlier than usual because it includes so many new features and improvements. Feel free to send feedback since you can still change the features. Unify Fixnum and Bignum into Integer Though ISO/IEC 30170:2012 doesn’t specif
シャープ Compet CS-2122L上の丸めセレクタ。左のツマミで切り上げ・四捨五入・切り捨てのいずれかを選択し、右のツマミで小数点以下の桁数を選択する。事務用電卓の中には、この機種のように計算結果を指定した桁数に丸めて表示できるものもある。 端数処理(はすうしょり)とは、与えられた数値を一定の丸め幅の整数倍の数値に置き換えることである。平たく、丸め(まるめ)ともいう。 常用的には、十進法で10の累乗(…100、10、1、0.1、0.01…)が丸め幅とされることが多いが、そうでない丸め幅をもつ処理は存在する。十進法以外のN進法について同様の概念を考えることもできる。 丸めの種類[編集] 凡例[編集] 丸めは任意の丸め幅に対し可能だが、以下では特に断らない限り、丸め幅を1とする(後段の「#例」では、丸め幅は0.1である)。任意の丸め幅で丸めるには、丸める前に丸め幅で割り、丸めた後に丸め幅
MPFR Links Internal links: Latest release: download – documentation – bugs – changes. Source code: information to use the development repository. Sample: to start with the MPFR library. FAQ: frequently asked questions. Credit: involved projects and developers. History: links to all MPFR releases and past events. Algorithms: documents describing algorithms used in MPFR. MPFR in the world: publicati
* [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cI
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く