Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
plop
--GNAT 4.9.3 with Ada.Numerics; use Ada.Numerics; with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions; with ada.float_text_io; use ada.float_text_io; procedure Normal_Random is function Normal_Distribution ( Seed : Generator; Mu : Float := 0.0; Sigma : Float := 1.0 ) return Float is begin return Mu + (Sigma * Sqrt (-2.0 * Log (Random (Seed), 10.0)) * Cos (2.0 * Pi * Random (Seed))); end Normal_Distribution; Seed : Generator; Distribution : array (1..1_000) of Float; begin Reset (Seed); for I in Distribution'Range loop Distribution (I) := Normal_Distribution (Seed); end loop; for i of Distribution loop put(i,exp=>0); end loop; end Normal_Random;
run
|
edit
|
history
|
help
0
Stack (Using Tasking)
Bc130400116
Normal Random Numbers
ada rocks!
es_perfecto.adb
Ada nested lexical scope
Ada Dimentional System
1d array as 4d with easy reshaping
macro-like function
susuma_dos_enteros.adb