Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math.random is not very random #3463

Closed
stevemessick opened this issue Jun 8, 2012 · 1 comment
Closed

Math.random is not very random #3463

stevemessick opened this issue Jun 8, 2012 · 1 comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report

Comments

@stevemessick
Copy link
Contributor

From anonymous editor feedback:

Math.random produces very bad results (very unrandom). Try doing a phase plot on a canvas (points of Xi,Xi-1) and you will see - not random.

 CanvasElement can = new CanvasElement(400, 400);
 document.body.elements.add(can);
 CanvasRenderingContext2D g = can.getContext("2d");
 g.canvas.style.border="solid 1px";
 double x = Math.random()400;
 double y = 0.0;
 for(int i=0;i<1000;++i) {
   g.beginPath();
   g.arc(x,y,2,0,Math.PI
2,true);
   y = x;
   x = Math.random()*400;
   g.closePath();
   g.fill();
 }
////////////////////////////////////////////////////////////////////////////////////
Editor Version: 8124

@whesse
Copy link
Contributor

whesse commented Jun 11, 2012

Added Duplicate label.
Marked as being merged into #499.

@stevemessick stevemessick added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report labels Jun 11, 2012
copybara-service bot pushed a commit that referenced this issue Jul 20, 2023
…string_scanner, test, test_descriptor, vector_math

Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/06d7288..a04ac3e):
  a04ac3e8  2023-07-19  Sam Rawlins  Format testing and fix static-type-parameter issue (#3465)
  a44ecebc  2023-07-19  Sam Rawlins  Move validation-related tasks to package:args (#3463)
  392812e4  2023-07-17  dependabot[bot]  Bump analyzer from 5.13.0 to 6.0.0 (#3458)
  642e8d8b  2023-07-17  Sam Rawlins  Convert 'p' prefixes to 'path' in test/ (#3462)

ecosystem (https://github.com/dart-lang/ecosystem/compare/2052a4c..27ff3e9):
  27ff3e9  2023-07-19  Moritz  Add debug message (#142)
  02703ce  2023-07-18  Moritz  Split commenting into new workflow (#141)
  a52ac63  2023-07-18  Moritz  Finish renaming `coverage_web` (#140)
  ffa1ecb  2023-07-17  Moritz  Health workflow updates (#134)

leak_tracker (https://github.com/dart-lang/leak_tracker/compare/515612e..098bafc):
  098bafc  2023-07-20  fzyzcjy  Update pubspec.yaml (#75)
  7606fd1  2023-07-19  Polina Cherkasova  Improve performance. (#98)
  e6778b3  2023-07-18  Polina Cherkasova  Explain case when static object causes leaks. (#96)
  cca1d77  2023-07-18  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.5.3 (#86)

markdown (https://github.com/dart-lang/markdown/compare/ee4e1b3..faabb1a):
  faabb1a  2023-07-17  Kevin Moore  Bump pkg:http (dev) dependency (#551)

mime (https://github.com/dart-lang/mime/compare/bdb66bd..799b398):
  799b398  2023-07-18  Kevin Moore  update lints, require Dart 3 (#101)
  d17e3ed  2023-07-18  Kevin Moore  blast_repo fixes (#100)

native (https://github.com/dart-lang/native/compare/7c474e1..2598ac6):
  2598ac6  2023-07-20  Daco Harkes  Package name spacing (#101)
  3d73b4a  2023-07-19  Daco Harkes  [native_assets_builder] Builder `out/` folder (#99)
  6308330  2023-07-19  Daco Harkes  Remove compiled files (#92)

string_scanner (https://github.com/dart-lang/string_scanner/compare/35657e2..413b57a):
  413b57a  2023-07-18  Kevin Moore  Require Dart 3, update lints (#61)
  53690da  2023-07-18  Kevin Moore  blast_repo fixes (#60)

test (https://github.com/dart-lang/test/compare/a92b5bb..37e54e3):
  37e54e32  2023-07-19  Nate Bosch  Handle initial message entirely within conditional (#2067)
  e76bffe8  2023-07-19  Nate Bosch  Expand dom interop to cover more uses (#2066)
  8bc188f7  2023-07-18  Lukas Klingsbo  docs: Fix grammar and typos in Checks readme (#2058)

test_descriptor (https://github.com/dart-lang/test_descriptor/compare/54a4c59..36d8617):
  36d8617  2023-07-18  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.5.3 (#53)

vector_math (https://github.com/google/vector_math.dart/compare/c147038..048777a):
  048777a  2023-07-19  moritzblume  Fix rotation around Y axis (#262)
  47a08ea  2023-07-17  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.2 (#293)

Change-Id: Id8010082c818c995aa7968327f98f347ff45761d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315221
Commit-Queue: Devon Carew <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants