随机数生成器 Hasard

码农软件 · 软件分类 · 其他开发相关 · 2019-11-01 13:27:53

软件介绍

Hasard 是一个伪随机码生成器 (PRNG) 类库。支持的随机算法包括:Park-Miller, Mersenne Twister, Linux device (/dev/urandom or /dev/random) 等等。

示例代码:

#include <hasard.h>
#include <stdio.h>

int main()
{
struct hasard_t *rnd;
rnd = hasard_new(HASARD_FAST);

printf("Heads or Tails? %s!\n", hasard_bool(rnd)?"Heads":"Tails");
printf("Dice: %i\n", hasard_int(rnd, 1, 6));
printf("Integer in 0..999: %u\n", hasard_ulong(rnd, 0, 999));
printf("Float in [0.0; 1.0]: %.3f\n", hasard_double(rnd, 0.0, 1.0));

hasard_destroy(rnd);
return 0;
}

本文地址:https://codercto.com/soft/d/18034.html

Beginning ARKit for iPhone and iPad

Beginning ARKit for iPhone and iPad

Wallace Wang / Apress / 2018-11-5 / USD 39.99

Explore how to use ARKit to create iOS apps and learn the basics of augmented reality while diving into ARKit specific topics. This book reveals how augmented reality allows you to view the screen on ......一起来看看 《Beginning ARKit for iPhone and iPad》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器