nadroj 
03062010 01:38 PM 
Quote:
just need some opinions if there should be handling of values such as infinities, negative zero or something else

I'm not quite sure what you mean by this. Do you mean you want to "generate" +/ infinity, negative 0, etc? If using the above method, since it has range [0.0,1.0) you of course can't do that. I think I recall reading that "0 == 0" evaluates to true, so you can ignore that "number" (also I think we generally don't ever consider "0" as a number in analysis anyway). Also, +/ infinity aren't numbers, so you can't generate them as numbers. However, of course, you could use some flag or value, a, so that whenever a is generated, you "pretend" a +/ infinity has occurred.
Quote:
I can't just stretch interval because I'm doing this for homework from numerical analysis ... stretching interval would make it have less possible values

I think you should be fine if you scale the numbers. You could just multiple the number by a power of ten, 10, 100, 100, etc., depending on how large you want the integral part to be. Say the number 0.1234506789 is generated, you multiply it by 100 to get 12.3450678900... Alternatively, generate a random double to get a fractional number, and add a random integer to it.
