Does random() only return 10 different random numbers, between 0 and 1?
I've tested it with ftos() and it only gave me 0.1, 0.4, 0.7 etc...
I dunno if ftos() round things up a little, but can random() return something like 0.15? 0.00001, etc?
Question about random()
Re: Question about random()
It's ftos. The original code used %5.1f for the format. Try multiplying the result by some scale (eg, 1000).
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/
Re: Question about random()
If using DP, you can use the sprintf builtin to view the number more fully. eg:
bprint(sprintf("random number is %f\n", random()));
This allows you to use your own precision etc.
Hint: try %g for a terse but accurate representation of a float.
Different engines can use different precision in ftos. Particuarly with nq vs qw.
bprint(sprintf("random number is %f\n", random()));
This allows you to use your own precision etc.
Hint: try %g for a terse but accurate representation of a float.
Different engines can use different precision in ftos. Particuarly with nq vs qw.