Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!
Hard to say.. in GUI reals can only have 2 decimals so it's somewhat easy to calculate. Reals in jass can be pretty long though 8 decimals or something.
However I doubt GetRandomReal() uses 8 decimals when getting a random real..
You should either truncate reals or use < and > to define a result range.
I don't know what the precision on GetRandomReal is, so depending on that, a perfect equal might happen between 0.01% (for 2 decimals after comma) and 0.00000001% (for 8 decimals after comma).
but does GetRandomReal(1,100) generetes 0.00 to 0.99?
All the stuff about the decimals of a real is just plain wrong. Especially Chaosy, who started all this.
Wc3 uses IEEE 754 single-precision binary floating-point format, or something very similar.
There are no GUI-reals and JASS-reals, it's all the same. Whenever you deal with reals the game converts your input to the closest real that can actually be represented in the format.
@OP: The chance for your conditions to be true are extremely small.
If you want to represent some percentage chance, just use GetRandomInt.
Do you want to make some percentage chance calculation out of my answer or what do you want actually?
If yes, as already advised, you should not do that and use GetRandomInt because we can't be sure how reals are handled exactly internally.
If you end up using something like GetRandomReal(1,1.022134211)<1.012412422 you deserve to be slapped with a trout
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.