Basic Pascal Tutorial/Chapter 1/Standard Functions/ja: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Basic Pascal Tutorial/Chapter 1/Standard Functions/ja
| Old | New | Line | |
|---|---|---|---|
| 1 | + | 1F - 標準関数 (著者: Tao Yue, 状態: 原文のまま) | |
| 2 | + | ||
| 3 | + | Pascal には利用可能な標準的数学関数がいくつか用意されている。 たとえば、パイ(π)のsinの値を求めるのは以下のようになる。 | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | value := sin (3.1415926535897932); | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | sin関数は3角法のすべての関数がそうであるように、ラジアンで表現される角度に適用できることに注意しよう。問題がなければ、値は0になるはずである。 | |
| 10 | + | ||
| 11 | + | 関数は関数名のあとにカッコで引数をつけて呼び出される。標準の Pascal 関数には以下のものが含まれる。 | |
| 12 | + | ||
| 13 | + | | Function | Description | Argument type | Return type | | |
| 14 | + | |----|----|----|----| | |
| 15 | + | | abs | 絶対値 | real or integer | 引数と同じ型 | | |
| 16 | + | | arctan | ラジアンでのアークタンジェント(arctan) | real or integer | real | | |
| 17 | + | | cos | ラジアンでコサイン(cosine) | real or integer | real | | |
| 18 | + | | exp | 指数(e to the given power) | real or integer | real | | |
| 19 | + | | ln | 自然対数 | real or integer | real | | |
| 20 | + | | round | もっと近い整数への丸め | real | integer | | |
| 21 | + | | sin | ラジアンでのサイン(sin) | real or integer | real | | |
| 22 | + | | sqr | 二乗 (指数 2) | real or integer | 引数と同じ型 | | |
| 23 | + | | sqrt | 平方根 (指数 1/2) | real or integer | real | | |
| 24 | + | | trunc | 端数の切り捨て | real or integer | integer | | |
| 25 | + | ||
| 26 | + | 順序型データタイプ(integer or char)は、その前後に明らかな値を持ち、次のような関数が利用できる。 | |
| 27 | + | ||
| 28 | + | | Function | Description | Argument type | Return type | | |
| 29 | + | |----------|----------------------|-----------------|--------------| | |
| 30 | + | | chr | ASCII 値で表した文字 | integer | char | | |
| 31 | + | | ord | 順序値 | integer or char | integer | | |
| 32 | + | | pred | 前の値 | integer or char | 引数と同じ型 | | |
| 33 | + | | succ | 後の値 | integer or char | 引数と同じ型 | | |
| 34 | + | ||
| 35 | + | 実数は順序型データタイプではない。なぜなら前後に明らかな値をもっていないからである。56.0の次の値は何だろうか? 56.1だろうか、あるいは56.01、56.001、それとも56.0001だろうか? | |
| 36 | + | ||
| 37 | + | しかし、整数の56に対しては明らかな前の値55と明らかな次の値57が存在している。 | |
| 38 | + | ||
| 39 | + | 同じことが文字にも言える。 | |
| 40 | + | ||
| 41 | + | ` 'b'`\ | |
| 42 | + | ` 次の文字: 'c'`\ | |
| 43 | + | ` 前の文字: 'a'` | |
| 44 | + | ||
| 45 | + | 上に挙げたのは完全なリストではない。現在の Pascal コンパイラはあらゆる種類の目的のために数千もの関数を含んでいるのである。さらに知りたければ自分のコンパイラの資料をチェックすると良い。 | |
| 46 | + | ||
| 47 | + | | | | | | |
| 48 | + | |----|----|----| | |
| 49 | + | | [[Basic Pascal Tutorial/Chapter 1/Assignment and Operations/ja|previous]] | [[Basic Pascal Tutorial/Contents/ja|contents]] | [[Basic Pascal Tutorial/Chapter 1/Punctuation and Indentation/ja|next]] | | |
| 50 | + | ||
| 51 | + | --- | |
| 52 | + | *From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/Standard Functions/ja", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
