RFC 8135 "Complex Addressing in IPv6" 日本語訳 「IPv6での複素数アドレス」 Independent Submission M. Danielson Request for Comments: 8135 Net Insight AB Category: Experimental M. Nilsson ISSN: 2070-1721 Besserwisser Networks 1 April 2017 IPv6での複素数アドレス 概要 128ビットの長さのIPv6アドレス (RFC 4291) は、今日の複雑なネットワークの世界のチャレンジに適合することができる新しく革新的なアドレススキーマを考慮することができます。 It also allows for new and improved security measures and supports advanced cloud computing challenges. このメモの位置付け This document is not an Internet Standards Track specification; it is published for examination, experimental implementation, and evaluation. このドキュメントはインターネットコミュニティのための実験的なプロトコルを定義します。 これは、他のいかなるRFCストリームに関係なく、RFCシリーズに貢献をしています。 RFC Editor は自らの裁量でこのドキュメントを公開することを選択しました。そして、実装や展開においてのその価値に関して何らかの声明を出すことはありません。 RFC Editorによって公表の承認をされたドキュメントはインターネット標準のいかなるレベルの候補でもありません。RFC7841のセクション2を見てください。 このドキュメントの現在の状況、正誤表、フィードバックの提供の仕方の情報については、http://www.rfc-editor.org/info/rfc8135 で得られるでしょう。 著作権 Copyright (c) 2017 IETF Trust and the persons identified as the document authors. 無断転載禁ず このドキュメントはBCP78とこのドキュメントの公表日に実施されているIETFドキュメントに関するIETF信託の法律条項 (http://trustee.ietf.org/license-info) の適用を受けます。 それらにこの文章に関する権利と制限が記述されていますので、慎重にこれらの文章を確認してください。 目次 1. はじめに ....................................................3 2. 必要条件 ...........................................3 3. 自然数アドレス ...............................................3 3.1. 整数アドレス ..........................................3 3.2. 素数アドレス ............................................3 3.3. 合成アドレス ........................................4 4. 複合アドレス ...............................................4 4.1. 浮動小数点アドレス .........................................4 4.2. 実数アドレス .............................................5 4.3. 虚数アドレス ........................................5 4.4. 飛行アドレス ...........................................5 4.5. 複素数アドレス ..........................................6 5. サポートされるアドレスのスキーマ ....................................6 5.1. 絶対値アドレス .........................................6 5.2. アドレス引数 ...........................................6 5.3. 安全なアドレス .............................................6 5.4. 仮想アドレス ..........................................7 5.5. 有理数アドレス .........................................7 5.6. 無理数アドレス .......................................7 5.7. 超越アドレス .....................................8 6. 幾何学的アドレス .............................................8 6.1. 円形アドレス ............................................8 6.2. 平方アドレス ...........................................8 6.3. 極座標アドレス ............................................9 6.4. 根アドレス ................................................9 6.5. 実装の考慮事項 ..............................9 7. IPv6 アドレス マッピング ...........................................10 8. IANAの考慮事項 ............................................10 9. セキュリティについての考慮事項 ........................................10 10. 参照 ....................................................11 10.1. 参照する参照文献 .....................................11 10.2. 有益な参照文献 ...................................12 付録 A. 二乗の Pi ............................................13 付録 B. 実装の例 ...............................14 著者のアドレス ................................................16 1. はじめに このドキュメントはIPv6での複雑なアドレスの基本的な概念を導入し、広範囲の複雑なアドレススキーマがサポートされ、更に開発されるようにします。 IPv4 [RFC791] および IPv6 [RFC4291] で使われているような伝統的なネットワークアドレスのスキーマは、固定小数点で表される符号付きあるいは整数値に閉じ込められています。 これは初期の実装に関して自然数を提供していますが、将来的なネットワークの挑戦へあまり適用されていません。 更に、これらの固定アドレスは今日の世界の可動性および仮想化に不適当だと証明されています。ここではクラウド計算が伝統的な固定アドレスモデルを定義します。 IPv6で許されるアドレスのサイズの増加、浮動小数点ハードウェアの価格の大幅な低下、および良く確立されたIEEE754 [IEEE754] での浮動小数点形式の可用性により、浮動小数点アドレスだけではなく複合アドレスへ踏み込むこともできます。 2. 必要条件 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 3. 自然数アドレス 3.1. 整数アドレス 伝統的なドレスは整数アドレスで、3つのドットの形式で表されます。例えば、整数1904334091 に関して 113.129.213.11 は珍しい IPv4 二重回文アドレスです。 これらの固定小数点アドレスは、インターネット上の各コンピュータが固定の場所、従って固定のアドレスを持っていた初期のネットワーク利用に良く適合していました。 これらのアドレスは自然数アドレスとしても知られています。 コンピュータがより強力になり大きな数つまり大きなアドレスを扱えるようになり、それらは輸送可能(例えば、ラップトップとモバイルフォン)にもなりました。 マシーンが相対的に固定小数点に制限されるというより、マシーンがあちこちに移動できるために、コンピュータの輸送可能な特徴により固定アドレスが非現実的なものになります。 3.2. 素数アドレス 素数アドレス (つまり、受信者の素数アドレス)は、整数アドレスの重要な部分クラスです。 そのようなアドレスは受信者自身によってのみ割り切ることができます。そのことはユニークアドレスとして見なされなければならないことを意味します。 While many prime addresses have been experimentally identified, it has proven to be quite hard to identify a prime address amongst other addresses without resorting to time-consuming computations. Current use includes security and intelligence, where post boxes are obscured amongst others using large prime addresses. 3.3. 合成アドレス 合成アドレスは2つあるいはもっと多くの素数アドレスから形成され、従って複数の素数アドレスのための生息地になることができ、共有アドレスを構成します。 大きな合成アドレスは素数アドレスと見分けることが難しいかも知れません。それは考慮の因数となりえます。 Composite addresses have also become quite important in addressing new light structures and are used in airplanes to make them lightweight and durable. これはクラウドに接続する時に重要です。 4. 複素数アドレス 4.1. 浮動小数点アドレス 浮動小数点アドレスはもっと柔軟で今日のモバイルコンピュータにより適応したアドレススキーマを考慮します。従って移動IPを考慮します [RFC5944]。 浮動小数点の数はIEEE 754 [IEEE754] で説明される浮動数の形式でよく確立されています。32ビットおよび64ビットの両方の浮動小数点数が表現のために使うことができます; これは128ビットのIPv6アドレスへ納める条件に良く合致します。 いかし浮動アドレスの使用は暗にデバイスが防水であることを意味します。 アプリケーションストアあるは配布サーバから防水アプリケーションをダウンロードしてください。 また、海水への露出が想定される場合は、ダクトテープの長期間の耐久性は制限されるため、デバイスを良く継ぎ接ぎしてください。 滑りのパフォーマンスを最善にするために、環境的に健全な適した潤滑油を塗布してください。 ダクトテープは浮動アドレスを物理アドレスのような固定のアドレスに貼るために使うことができます。 For long-term outdoor adhesion, please use UV-stable, nuclear-grade duct tape in layers: Layer 1 [OSI], the physical layer, for affixing the floating address to the physical address and then final layer, called Layer 7, for the application of UV protection. Intermediate layers can be applied depending on the complexity needed. 4.2. 実数アドレス 浮動小数点アドレスの重要な特徴は、IPパケットがネットワークを通じてその中に道を取るように、浮動アドレスを持つデバイスの実数アドレスに接続する必要があるということです。 アドレスの一部を実数浮動小数点値として振舞わせることにより、このアドレススキーマ内の実数アドレスを表現することができます。従って複素数アドレス問題を解決します。 実数アドレスは一般的には不動産です。 不動産が個々の道インタフェース上に二つあるいはそれ以上の道のネットワークに接続する場合、マルチホーミングがサポートされます。 それぞれの道インタフェースはしばしば複数の実数アドレスとして扱われるかも知れません。 モバイルのホームは現在の実数アドレスに割り当てられます。 4.3. 虚数アドレス Another important aspect of floating-point addresses is that they can be in several possible locations; thus, one must be able to imagine the address as being somewhere other than where the real address would make you believe. 虚数アドレスはこの直行プロパティを提供します。 虚数アドレスが0であると分かる場合、虚数アドレスと実数アドレスは等しいと見なされます。そして実数アドレスが見つかります。 虚数アドレスは通常の不動産上の家の場所を扱うのに重要です。つまり、クラウド計算です。 クラウドは虚数アドレスを使って識別することができます。これの浮動アドレスはクラウドが徐々に実数アドレスのそばを漂うに従って適用されます。 風の強い状況では、これは行うことが難しいかも知れません; ネットワークの嵐の間、クラウドの実数アドレスはとても不安定になるかも知れません。 そのような嵐は時折あまりに強くなり、それらが不動産に影響を与え、家を再整理し、実数アドレスを完全に現実離れしたものにします。 4.4. 飛行アドレス 虚数アドレスの拡張は飛行アドレス形式です。これは鳥類キャリアの移動性を適用されます。[RFC6214]で説明されるように鳥類キャリアとそのデータグラムは飛行アドレスを使って住所を指定します。これは一般的にはICAO クラス G [ICAO-A11] 領空を取り上げ、艇層テクノロジから期待されるようにクラウドの下にあります。 4.5. 複素数アドレス 実数アドレスと虚数アドレス部分の説明を使って、複素数アドレスの全幅を理解することができます。 実数および虚数部分の両方とも [IEEE754] で説明される64ビットの浮動小数点数で表現されます。従ってアドレスの浮動小数点の特徴を考慮します。 実数アドレス部分はデバイスの実数アドレスを提供し、一方で虚数部分は浮動小数点アドレスの直行アドレスを考慮します。 これは実数および虚数アドレスの両方が現れる複素数アドレススキーマを考慮します。 複素数アドレスは普段通りにアドレス計算を考慮しますが、今では固定小数点の制限を超えることができます。 想像を妨げる初期の浮動小数点ハードウェアの高コストのため、以前はアドレスに虚数部分を追加することができませんでした。 5. サポートされるアドレススキーム 5.1. 絶対アドレス 法の執行による使用を含む、だがそれだけでは無い多くの目的のためにデバイスの絶対アドレスを定めることがますます重要になっています。 これは固定小数点アドレスでも管理可能でしたが、アドレスの移動および浮動小数点アドレスの増加によってますます難しくなっています。 複素数アドレススキーマは、複素数アドレスに絶対値関数を実施することで、絶対アドレスを取得するメソッドを提供します。 5.2. アドレス引数 あるサービスあるいは機能のアドレスについての議論があることはますます増えています。それはアドレスの引数に繋がります。 これは固定小数点アドレスのもう一つの難しさで、それらの1次元の形式は引数が解決されることを考慮していません。 複素数アドレススキーマはこれらのアドレスの引数への洗練された解決法を提供します。複素数アドレスの引数(つまりarctan あるいはatan)関数を取ることでアドレス引数の結果は些細なものと分かるでしょう。 適切な関数を使うことで、完全な引数の解決は曖昧さの兆候も無く見つかるでしょう。 5.3. 安全なアドレス 安全なアドレスはセーフハウスのアドレスです。 これは様々なセキュリティのシナリオで使われます -- 必要とする人が安全なアドレスにあるセーフハウスに辿り着くことができるという点で安全なままですが、アドレスがこの役割を持っているという表示はありません。 想像力を使うことで、このアドレスが実数では無くなります。単純に実数アドレスと見なされないほど虚数部分を大きくします。 それは浮動小数点アドレスなため、実数アドレスは0にすることができ、したがって完全に虚数にすることができ、実数アドレスを定めることが難しい場合は、アドレス引数はどの実数アドレスとも直行するでしょう。 それでも必要な時は絶対値アドレスを当然定めることが可能です。 5.4. 仮想アドレス 仮想アドレスは、同じネットワークインタフェースが複数のアドレスを持つことができる時に、伝統的に重要な概念を持ちます。 複素数アドレススキーマを使って、虚数部分はあるインタフェースの単なる通常の複数の実数アドレスよりもより広い領域の可視化を考慮します。 これは単に誰かほかの人のコンピュータを考慮だけの通常のクラウド計算を超えます。 The new imaginative address capabilities and higher altitude addresses due to the increased range allow you to operate a cloud within a cloud, so that you just run on top of somebody else's cloud. この高高度は高パフォーマンス計算の超音速巡行速度を考慮します。 5.5. 有理数アドレス エンジニアはアドレスの問題も含めて問題を常に合理的に見る傾向があります。 しかし伝統的な固定小数点アドレスは有理数アドレスの部分集合だけをサポートしますが、新しい複素数アドレススキーマを使ってより大きな原理があることを考慮しながらより大きな有理数アドレスの部分集合に手を届かせるあるいは近づけることができます。 The rationale for this is that with the use of floating addresses, the power of 2 now can perfectly divide. Further, approximations for other dividends can often be sufficiently precise. The full scope of rational numbers has not been reached, however, as the committee was quite imprecise on the use of floating addresses but agreed that this initial support of rational addresses could be acknowledged and helpful while its usage is TBD. 5.6. 無理数アドレス 無理数アドレスのサポートは伝統的なアドレススキーマでは見すぼらしいものでした。固定小数点アドレスは設計によるどのような無理数の挙動もサポートされておらず、無理数アドレスの証明でさえちょっと書き留めておく程度でした。 新しいスキーマは無理数アドレスの近似がサポートされることを考慮します; これがなぜ必要とされるのかという論拠も無いことが分かっていますが、それは今日の世界の不合理さに対処するための素敵な機能です。 5.7. 超越アドレス 無理数アドレスの自然な拡張として、超越アドレスへの近似を含めることができます。これは物理アドレスあるいは実数アドレスを超えるものです。 While only approximated due to limited precision, they can still be used to locate the floating address for the life of Pi [PI], as Pi's life floats by. 6. 幾何学的アドレス 6.1. 円形アドレス 現実の世界の複雑さを上手く処理するために、実数アドレス(有理数あるいは無理数の両方)は常にそれらが表現されるように一つにまとめる必要があります。 この丸めは円形アドレスとして知られるものを提供し、丸め関数を使って行われます。 この慣習は複素数アドレススキーマにおいて支持され、有理数および無理数アドレスのサポートのために必要です。 円形アドレスはトークンリング [IEEE-802.5] あるいは Resilient Packet Ring (RPR) [IEEE-802.17] のようなリンク型のネットワークの周りでパケットを効率的に転送するために必要です。 一般的な丸めの単語には "ring", "circle" および "sphere" が含まれます; ネットワークで使う場合には、他の丸めの単語はお勧めされません。 6.2. 平方アドレス 安定しているため、使用中のいくつかのアドレスはインターネット上で直接使うことができません。 Addresses in text form are often referred to as square addresses, because the characters traditionally take up a square on the screen and because they act as a square peg in the round hole of Internet addresses. これらの平方アドレスを丸め浮動小数点数に変換するために、ホストテーブルを置き換えるためにDomain Name Service (DNS) が導入されました。 ホストテーブルは平方数を調べ、丸めた形に変換する保守的な方法です。 そのようなテーブルは全てのよく知られた平方数について発表されていますが、新しい平方数が起こり続けているためそれらは本質的に時代遅れなものです -- 新しい丸められた数はこれらの平方数から計算され、表にされて発表されなければなりません。 平方アドレスはしばしば四角いpi を使います(付録Aを見てください)。 6.3. 極座標アドレス 平方アドレスについての誤解は、それらが世界を平らな大地と表していることです。 複素数アドレススキーマはデカルト座標をサポートする一方で、代わりの極座標アドレスを形成することができます。 Since a flat earth would not have poles through which therotation axis would fit, this proves that the earth is not flat in terms of square addresses but only has a square address representation. 極座標アドレスは絶対アドレスとアドレス引数メソッドを使って簡単に得ることができます。 複素数アドレスの再生は複素数極座標上で指数関数を使うことで簡単に行うことができます。 極座標アドレスはサンタクロース、北極に住んでいるとされる、を探すために使うこともできます。 サンタクロースを見つけるにはある程度の想像力が必要なので、虚数アドレスの利用によってのみこのアドレスに辿り着くことができます。 伝統的な整数および固定アドレススキーマはそのような虚数アドレスを考慮しませんが、複素数アドレススキーマは簡単にそれを処理します。 北アメリカ航空宇宙防衛司令部(NORAD)サンタ追跡器は、彼らの秘密電話のアドレスが漏洩した時に想像力に富んだ極座標アドレス無しには追跡することができなかったでしょう。 6.4. ルート サーバ DNSは周知のルートサーバ、ノードのアドレスを手に入れるためのルートサービスを提供する、の小さな集合を使います。 The complex address provides a solution such that each client can in itself act as a root server as they now can use built-in floating- point hardware or software to get the root address from the squared address. This offloads the root servers for common benefits, but the traditional root servers can operate in parallel, easing the transition to the complex address system. 6.5. 実装の考慮事項 複素数アドレススキーマに必要とされる浮動小数点アドレスと複素数アドレスの実装は、今日では簡単です。 IEEE 754 [IEEE754] は浮動小数点数の表現のための一般的かつ合意に基づく形式を考慮します。 64ビットの浮動小数点表現は良く確立され、広範囲のデバイスに渡ってサポートされます。 CおよびFORTRANを含む広範囲のコンピュータ言語でもサポートされます。 C標準ライブラリ(あるいはlibc)によって本質的にしかるべき方法での全ての現代的な言語でそれをサポートをします。 An independent implementation exists for Intercal. ISO C99 [C99] を使って のincludeは最小の実装の努力で全ての複素数アドレスの局面を効率的に処理することができる、より直接的な複素数のサポートを提供します。 7. IPv6 アドレス マッピング IPv6アドレス形式での複素数アドレスを運搬するために、以下のマッピングが提供されています: 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |6 3| |3 複素数アドレス (実数部分) 2| +---------------------------------------------------------------+ |3 | |1 複素数アドレス (実数部分) 0| +---------------------------------------------------------------+ |6 3| |3 複素数アドレス (虚数部分) 2| +---------------------------------------------------------------+ |3 | |1 複素数アドレス (虚数部分) 0| +---------------------------------------------------------------+ 128ビット IPv6 アドレスは2つの 64ビット部分に分割されます。ここで、上位部分は複素数アドレスの実数部分を保持し、下位部分は虚数部分を保持します。 それらは[IEEE754]で定義される64ビットの浮動小数点数として表現されます; 従って、実数および虚数アドレスは IEEE 754 で説明される形式でなければなりません。 Since the real address is held in the real part of the complex address and the imaginary address is held in the imaginary part of the complex address, the proposed representation allows for compiler optimization such that these operations can be performed without performance hits, as could otherwise be expected with any real or complex addressing scheme. 8. IANA問題 この文章はどのようなIANA対策も必要としませんが、IANAは少し面白いと思うかも知れません。 9. セキュリティ問題 0での除算はまだ 数値では無い(NaN) 値を与えるため、複素数アドレスは安全では無いと見なされるべきです。 Users will have to be careful to identify the NaN as they can indicate infinity addresses, which are unrealistic as one needs to confine the address length to the address space. Many other traditional unsafe operations for fixed-point addresses have, however, been resolved. For example, the error condition of having the square address of -1 is readily resolved as the root address becomes the complex address i. Thus, it has the real part of 0, which is reasonable for an address that is not real, and an imaginary part of 1, which is in itself reasonable since one can imagine this error to occur. Division by 0 and other floating-point address calculations can cause a floating-point interrupt, which causes the execution address to deviate; it is typically pushed on a stack and replaced by the interrupt handler address. Recovery from such interrupts may require further recursive calls; hence, the overall computation time is unpredictable. It can cause a complete core dump, and dumping the core can have significant effects on the propulsion system and the time to reach anywhere in the address space. Care must be taken to avoid such measures, or engineering will be quite upset. Dumping the core also widely breaks security protocols, as leaks can have widespread consequences. NaN is also known as "No Agency Number", to mark the importance of keeping things secure. 10. 参照 10.1. 参照する参考文献 [C99] ISO, "Information technology -- Programming Languages -- C", ISO/IEC 9899, 1999. [IEEE754] IEEE, "IEEE Standard for Floating-Point Arithmetic", IEEE 754, DOI 10.1109/IEEESTD.2008.4610935. [OSI] ISO, "Information technology -- Open Systems Interconnection -- Basic Reference Model: The Basic Model", ISO/IEC 7498-1, 1994. [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791, DOI 10.17487/RFC0791, September 1981, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, DOI 10.17487/RFC4291, February 2006, . [RFC6214] Carpenter, B. and R. Hinden, "Adaptation of RFC 1149 for IPv6", RFC 6214, DOI 10.17487/RFC6214, April 2011, . 10.2. 有益な参考文献 [ICAO-A11] ICAO, "Air Traffic Services, Annex 11 to the Convention on International Civil Aviation", July 2001, . [IEEE-802.17] IEEE, "IEEE Standard for Information Technology - Telecommunications and Information Exchange between Systems - Local and Metropolitan Area Networks - Specific Requirements Part 17: Resilient Packet Ring (RPR) Access Method and Physical Layer Specifications", IEEE 802.17, DOI 10.1109/IEEESTD.2011.6026209. [IEEE-802.5] IEEE, "IEEE Standard for Information Technology - Telecommunications and Information Exchange between Systems - Local and Metropolitan Area Networks - Part 5: Token Ring Access Method and Physical Layer Specifications", IEEE 802.5, DOI 10.1109/IEEESTD.1992.7438701. [PI] "Life of Pi", 20th Century Fox, 2012. [pibill] Wikipedia, "Indiana Pi Bill", March 2017, . [RFC5944] Perkins, C., Ed., "IP Mobility Support for IPv4, Revised", RFC 5944, DOI 10.17487/RFC5944, November 2010, . Appendix A. Square Pi When using square numbers, it is customary to use square pi, a number that has seen limited exposure in traditional texts but is widely used in computer science. It is thus appropriate to publish a few related notes on square pi in order to assist users of square addresses on its correct usage. While traditional pi or round pi is an irrational number, it can be rounded off to 3.14 or 3.14159; it has an incomprehensible number of decimals, which is quite inappropriate for a round number, but as we keep rounding it to fit our needs, we keep rationalizing it from its irrational behavior. The radius of an object is the closest to the center of the object you get. The circumference is the radius times 2 pi. The diameter is the shortest distance across the object, which is thus the radius times 2. The area is pi times the square of radius. For a round circle, the radius is from the center to anywhere on the circumference. For a square circle, the radius only reaches the circumference on the four points located closest to the center. These are typically oriented such that the real and imaginary axis goes through them, which is helpful in calculations, and no rotation symmetries need to be considered. The square pi fills the same purpose as the round pi, but rather than being adapted to round objects, it is adapted to square objects. For a square circle, the math is exactly the same as for round circles, provided that the square pi is used with square circles and that round pi is used with round circles. The value of square pi is 4. The value of square pi adapts really well to the way that computers calculate, which is also why computer results often are represented in square numbers, providing a bit of a square feeling. It should be noted that the square root of pi is often used, and the square root of square pi is naturally 2, which is very easy to handle in calculations and effectively reduces the risk of irrational numbers. Please note that the square pi should not be confused with the Indiana Pi Bill [pibill], which does not discuss the square pi but a failed attempt to do square calculation of the area and circumference of a round circle using traditional tools like rulers and compasses. Appendix B. Implementation Example The following is a simple implementation example to illustrate how some core concepts can be implemented in (as defined in ISO C99 [C99]). #include #include #include // Define type for complex address typedef complex ca; // Create complex address ca ca_create_complex_address(double real_address, double imaginary_address) { return real_address + I * imaginary_address; } // Get real address double ca_get_real_address(ca ca_val) { return creal(ca_val); } // Get imaginary address double ca_get_imaginary_address(ca ca_val) { return cimag(ca_val); } // Get complex address complex ca_get_complex_address(ca ca_val) { return ca_val; } // Get floating address double ca_get_floating_address(ca ca_val) { return creal(ca_val); } // Get physical address double ca_get_physical_address(ca ca_val) { return cimag(ca_val); } // Get absolute address double ca_get_absolute_address(ca ca_val) { return cabs(ca_val); } // Get address argument double ca_get_address_argument(ca ca_val) { return carg(ca_val)*360/(2*M_PI); } int main() { ca ca1, ca2; ca1 = ca_create_complex_address(1.0, 0.0); printf("The complex address (%f,%f)\n", creal(ca1), cimag(ca1)); printf("has the real address %f and imaginary address %f\n", ca_get_real_address(ca1), ca_get_imaginary_address(ca1)); printf("This represents the floating address %e and \ physical address %f\n", \ ca_get_floating_address(ca1), ca_get_physical_address(ca1)); ca2 = ca_create_complex_address(0.0, 1.0); printf("The complex address (%f,%f)\n", creal(ca2), cimag(ca2)); printf("This represents the absolute address %f\n", ca_get_absolute_address(ca2)); printf("The address argument resolution is %f\n", ca_get_address_argument(ca2)); return 0; } 著者のアドレス Magnus Danielson Net Insight AB Vastberga Alle 9 Hagersten 12630 Sweden Email: magda@netinsight.net Mans Nilsson Besserwisser Networks Email: mansaxel@besserwisser.org