博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nextgaussian_Java Random nextGaussian()方法与示例
阅读量:2529 次
发布时间:2019-05-11

本文共 1764 字,大约阅读时间需要 5 分钟。

nextgaussian

随机类nextGaussian()方法 (Random Class nextGaussian() method)

  • nextGaussian() method is available in java.util package.

    nextGaussian()方法在java.util包中可用。

  • nextGaussian() method is used to generate the next pseudo-random Gaussian double value with mean 0.0 and standard deviation 1.0 from this Random Value Generator.

    nextGaussian()方法用于从该随机值生成器生成平均值为0.0,标准差为1.0的下一个伪随机高斯双精度值。

  • nextGaussian() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.

    nextGaussian()方法是一种非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • nextGaussian() method does not throw an exception at the time of returning double.

    返回double时, nextGaussian()方法不会引发异常。

Syntax:

句法:

public double nextGaussian();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of the method is double, it returns next pseudo-random Guassian distributed double value with mean and standard deviation from this Random Generator.

该方法的返回类型为double ,它从该随机数发生器返回下一个具有均值和标准差的伪随机Guassian分布double值。

Example:

例:

// Java program to demonstrate the example // of double nextGaussian() method of // Randomimport java.util.*;public class NextGuassianOfRandom {
public static void main(String args[]) {
// Instantiates Random object Random ran = new Random(); // By using nextGuassian() method is // to return double guassian pseudo-random // value with mean 0.0 and SD 1.0 by // using Random Value Generator double val = ran.nextGaussian(); // Display val System.out.println("ran.nextGaussian(): " + val); }}

Output

输出量

RUN 1:ran.nextGaussian(): 1.1146938453650543RUN 2:ran.nextGaussian(): -0.23741062599148818RUN 3:ran.nextGaussian(): 0.147051482639119

翻译自:

nextgaussian

转载地址:http://ugxzd.baihongyu.com/

你可能感兴趣的文章
20145303刘俊谦 Exp7 网络欺诈技术防范
查看>>
原生和jQuery的ajax用法
查看>>
iOS开发播放文本
查看>>
20145202马超《java》实验5
查看>>
JQuery 事件
查看>>
main(argc,argv[])
查看>>
源码:Java集合源码之:哈希表(二)
查看>>
【HDU 3709】 Balanced Number (数位DP)
查看>>
JsonPath的使用
查看>>
企业常用的站内收索、QQ群、在线客服
查看>>
Centos下安装nginx步骤解析
查看>>
EntityFramework Code First 添加唯一键
查看>>
在线教育工具—白板系统的迭代1——bug监控排查
查看>>
招行ODC项目表彰
查看>>
js补充知识点-label应用
查看>>
给构造函数(constructor)创建对象(object)
查看>>
局域网访问PHP项目网站 用IP地址进入
查看>>
VM虚拟机,Linux系统安装tools过程遇到 what is the location of the “ifconfig” program
查看>>
Jquery实现循环删除Reaper某一行
查看>>
脚本升级openssh
查看>>