スキップしてメイン コンテンツに移動

投稿

12月, 2013の投稿を表示しています

3.4E-38

えっとね、10のべき乗の省略形なのさぁ。「○○○E△△△」 はねぇ 「○○○×(10の△△△乗)」 っていうことだよぉ。だから、「3.4E-38」 は 「3.4×(10の-38乗)」 ってことだよぉ。 桁が大きい数とか、小数点以下の桁が長い数とかで、ゼロ 「0」 をたくさん書くより短いく書けて、なおかつ間違えにくい数の書き方なんだよぉ。例えば、「3.4E-38」 を 普通に書くと 「0.000000000000000000000000000000000000034」 だけど、そんなふうに書くの嫌でしょぉ?なんだか何桁か分かんないから、書くとき間違えても気が付かなさそうだもんねぇ。 ちなみに、「E」 の語源は、「指数」 を意味する英語 「exponent」 の頭文字だよぉ。 で、3.4E-38~3.4E+38 っていうのは、絶対値での数の範囲のことだから、 .... 正の数なら 3.4×(10の-38乗) 以上 3.4×(10の+38乗) 以下の範囲、 .... 負の数なら -3.4×(10の+38乗) 以上 -3.4×(10の-38乗) 以下の範囲 で数値を表せるっていういみだょぉ。

3.4E-38

えっとね、10のべき乗の省略形なのさぁ。「○○○E△△△」 はねぇ 「○○○×(10の△△△乗)」 っていうことだよぉ。だから、「3.4E-38」 は 「3.4×(10の-38乗)」 ってことだよぉ。 桁が大きい数とか、小数点以下の桁が長い数とかで、ゼロ 「0」 をたくさん書くより短いく書けて、なおかつ間違えにくい数の書き方なんだよぉ。例えば、「3.4E-38」 を 普通に書くと 「0.000000000000000000000000000000000000034」 だけど、そんなふうに書くの嫌でしょぉ?なんだか何桁か分かんないから、書くとき間違えても気が付かなさそうだもんねぇ。 ちなみに、「E」 の語源は、「指数」 を意味する英語 「exponent」 の頭文字だよぉ。 で、3.4E-38~3.4E+38 っていうのは、絶対値での数の範囲のことだから、 .... 正の数なら 3.4×(10の-38乗) 以上 3.4×(10の+38乗) 以下の範囲、 .... 負の数なら -3.4×(10の+38乗) 以上 -3.4×(10の-38乗) 以下の範囲 で数値を表せるっていういみだょぉ。

primitive

design pattern

In order to answer the question of what a “thing” is, you have to first determine what its defining characteristics are. Other languages will refer to this as a “field”, a “member”, or even just a “variable”. However, in Objective-C the defining characteristics of an object are shown by its  properties . Describing the Object On to the second critical question for every object — what exactly does the object  do ? A programmatic description of what an object does is almost universally called a  method . Think about the common actions of the vehicles in the photos above:

property default assign

The article linked to by MrMage is no longer working. So, here is what I've learned in my (very) short time coding in Objective-C: nonatomic vs. atomic - "atomic" is the default. Always use "nonatomic". I don't know why, but the book I read said there is "rarely a reason" to use "atomic". (BTW: The book I read is the BNR "iOS Programming" book.) readwrite vs. readonly - "readwrite" is the default. When you @synthesize, both a getter and a setter will be created for you. If you use "readonly", no setter will be created. Use it for a value you don't want to ever change after the instantiation of the object. retain vs. copy vs. assign "assign" is the default. In the setter that is created by @synthesize, the value will simply be assigned to the attribute. My understanding is that "assign" should be used for non-pointer attributes. "retain" is needed when the attribute ...