C#��VB.NET�łׂ���i�ݏ�j���v�Z����ɂ́H�F.NET TIPS

» 2005�N04��15�� 05��00�� ���J
[�����F�M�C�f�W�^���A�h�o���e�[�W]
.NET TIPS
Insider.NET


u.NET TIPSṽCfbNX

�A�ږڎ�

�@�ׂ���i�ݏ�j�Ƃ́A2��3��i��8�j�Ȃǂ̉��Z�ł���BVB.NET�ł́A�ׂ���́u�O���Z�q�v���g�p���ċ��߂邱�Ƃ��ł���B���Z�̌��ʂ�Double�^�ƂȂ�B

Dim result As Double = 2 ^ 3 ' result��8


�@C#�ɂ́A���̂悤�Ȃׂ�������߂邽�߂̉��Z�q�͗p�ӂ���Ă��炸�AMath�N���X�iSystem���O��ԁj�̐ÓI���\�b�h�ł���Pow���\�b�h���g�p����K�v������B

double result = Math.Pow(2, 3); // result��8


�@�������AMath.Pow���\�b�h��VB.NET�ł����p�”\���B

Dim result As Double = Math.Pow(2, 3) ' result��8


�@�ȉ���2�ׂ̂�������߂�ȒP�ȃT���v���E�v���O�����������B

// powofnum.cs

using System;

public class PowerOfNumber {
  static void Main() {

    for (int exp = 0; exp < 8; exp++) {
      Console.WriteLine(Math.Pow(2, exp));
    }
    // �o�́F
    // 1
    // 2
    // 4
    // 8
    // 16
    // 32
    // 64
    // 128
  }
}

// �R���p�C�����@�Fcsc powofnum.cs

2�ׂ̂����\������C#�̃T���v���E�v���O�����ipowofnum.cs�j
powofnum.cs�̃_�E�����[�h

' powofnum.vb

Imports System

Public Class PowerOfNumber
  Shared Sub Main()

    For exp As Integer = 0 To 7
      Console.WriteLine(2 ^ exp)
    Next
    ' �o�́F
    ' 1
    ' 2
    ' 4
    ' 8
    ' 16
    ' 32
    ' 64
    ' 128

    For exp As Integer = 0 To 7
      Console.WriteLine(Math.Pow(2, exp))
    Next
    ' �o�́F
    ' 1
    ' 2
    ' 4
    ' 8
    ' 16
    ' 32
    ' 64
    ' 128
  End Sub
End Class

' �R���p�C�����@�Fvbc powofnum.vb

2�ׂ̂����\������VB.NET�̃T���v���E�v���O�����ipowofnum.vb�j
powofnum.vb�̃_�E�����[�h

�@�Ȃ��AC#�ɂ��u�O���Z�q�v�͗p�ӂ���Ă��邪�A����͔r���I�_���a�i�r���IOR�j�����߂邽�߂̉��Z�q�ł���i�]����C#�ł́u2 ^ 3�v��1�ƂȂ�j�̂Œ��ӂ��K�v���B

�J�e�S���FVisual Basic .NET�@�����ΏہF���Z�q
�J�e�S���F�N���X�E���C�u�����@�����ΏہF���l�֐�
�g�p���C�u�����FMath�N���X�iSystem���O��ԁj


u.NET TIPSṽCfbNX

�u.NET TIPS�v

Copyright© Digital Advantage Corp. All Rights Reserved.

'; if( !this.isSubscription ) { this.insertTarget = document.querySelector('#cmsBody .subscription') || document.querySelector('#cmsBody .inner'); } }; BodyAdIMSWithCCE.prototype = Object.create(BodyAdContent.prototype); BodyAdIMSWithCCE.prototype.activate = function () { refreshGam('InArtSpecialLink'); } // global reference window.itm = itm; //entry point BodyAdEventBase.polyfill(); const bodyAdManager = BodyAdManager.getInstance(); bodyAdManager.addEventListener(BodyAdManager.EVENTS.READY, function (ev) { bodyAdManager.loadAdvertise(); }); bodyAdManager.init(); })();
�X�|���T�[����̂��m�点PR

���ڂ̃e�[�}

4AI by IT - AIAAA
Microsoft  WindowsőO2025
AI for GWjAO
[R[h^m[R[h Zg by IT - ITGWjArWlX̒SŊ􂷂gD
Cloud Native Central by IT - XP[uȔ\͂gD
�V�X�e���J���m�E�n�E �y�����i�r�zPR
���Ȃ��ɂ������߂̋L��PR

RSS�ɂ‚���

�A�C�e�B���f�B�AID�ɂ‚���

���[���}�K�W���o�^

��IT�̃��[���}�K�W���́A �������A���ׂĖ����ł��B���Ѓ��[���}�K�W�������w�ǂ��������B