dotnet / dotnet/dotnet-api-docs

Missing explanation

Open
#9,711 3 comments 1 reaction 0 assignees View on GitHub
area-System.DateTime Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

https://learn.microsoft.com/de-de/dotnet/api/system.random.-ctor?view=net-8.0#system-random-ctor(system-int32)

The example code uses:
`(int) DateTime.Now.Ticks & 0x0000FFFF`

There is no explanation why this is used. The example mentions the seeds generated might end up the same when executed too fast. Is this an example safety because Ticks changes from higher to lower bits?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.