0 votes

var a = rand_range(1.5, 2.5)

Is there a chance a = 1.5 or a = 2.5?
so the question is range is [from, to], or (from, to)?

in Engine by (17 points)

1 Answer

+1 vote
Best answer

It's extremely unlikely to ever obtain a or b exactly...

Having a look here: https://github.com/godotengine/godot/blob/master/core/math/random_pcg.h#L98

According to the implementation, the function is based on a 0..1 function which has a case of returning 0, so I'd say a is included. But you have to be extremely lucky to ever get it in your lifetime.

by (27,954 points)
selected by

Thank you so much

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.