should be 
    from + (to - from) * r.nextDouble()