[0,1)区間内の実数値の擬似乱数を53-bit resolutionで生成します

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static double fnFIE_mtrand_res53(
	ref F_RANDDESC r
)
Visual Basic
Public Shared Function fnFIE_mtrand_res53 ( 
	ByRef r As F_RANDDESC
) As Double

Parameters

r
Type: fvalgcli..::..F_RANDDESC%
擬似乱数列生成用データ。 fnFIE_mtrand_init(UInt32, F_RANDDESC%) または fnFIE_mtrand_init_by_array(array<UInt32>[]()[][], Int32, F_RANDDESC%) で 初期化されている必要があります。

Return Value

Type: Double
擬似乱数:[0,1)区間内(0≦value<1)の実数値(53-bit resolution) を返します。

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        [FvPluginExecute]
        public void fnFIE_mtrand_res53()
        {
            uint seed = 11111;    // 適当な値.
            F_RANDDESC r = new F_RANDDESC();
            double random = -1;        // 擬似乱数.

            // 初期化.
            api.fnFIE_mtrand_init(seed, ref r);

            // 結果を出力する.
            ConsoleOut.WriteFunctionName(":\n");
            for (int i = 0; i < 5; i++)
            {
                random = api.fnFIE_mtrand_res53(ref r);
                Console.WriteLine("random = {0}", random);
            }
            Console.Write(" ...");
            ConsoleOut.IsTrue(random != -1);
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    <FvPluginExecute> _
    Public Sub fnFIE_mtrand_res53()
        Dim seed As UInteger = 11111
        ' 適当な値.
        Dim r As New F_RANDDESC()
        Dim random As Double = -1
        ' 擬似乱数.
        ' 初期化.
        api.fnFIE_mtrand_init(seed, r)

        ' 結果を出力する.
        ConsoleOut.WriteFunctionName(":" & vbLf)
        For i As Integer = 0 To 4
            random = api.fnFIE_mtrand_res53(r)
            Console.WriteLine("random = {0}", random)
        Next
        Console.Write(" ...")
        ConsoleOut.IsTrue(random <> -1)
    End Sub
End Class

See Also