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

random(9,0) is always 9 #954

Closed
Symbol1 opened this issue Dec 14, 2020 · 1 comment
Closed

random(9,0) is always 9 #954

Symbol1 opened this issue Dec 14, 2020 · 1 comment

Comments

@Symbol1
Copy link

Symbol1 commented Dec 14, 2020

Version: 3.1.7.a; I guess it's irrelevant.

On page 1042, or equivalently these two lines,
it is stated that if two numbers x, y are given, a random integer between x and y is generated.
However, if x > y, the generated number is always x.
Perhaps we can

  • state in doc that x < y is expected, or
  • modify the codebase to reorder x, y.

MWE

\documentclass{article}
\usepackage{tikz}
\begin{document}
	\foreach\ind in{1,...,99}{
		\pgfmathparse{random(0,9)}\pgfmathresult
	}
	\foreach\ind in{1,...,99}{
		\pgfmathparse{random(9,0)}\pgfmathresult
	}
\end{document}
@hmenke
Copy link
Member

hmenke commented Dec 14, 2020

I think the order should not matter, so I reclassified this from manual to pgfmath bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants