![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | jz2010927 |
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)?
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | jz2010927 |
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)?
![]() |
Reply From: | Zylann |
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.
Thank you so much
jz2010927 | 2019-09-18 22:37