0

I am trying to use the float version of rsRand and I get an error for the call being ambiguous. I have a hunch that maybe the method is not API 11 though I am not sure.

float test = rsRand(5);// okay
float test2 = rsRand(5.1);// error: call to 'rsRand' is ambiguous

The second line (test2) throws an error for being ambiguous though the reference shows rsRand can be used in integer and float forms. Maybe I am just making a silly mistake?

RenderScript reference

ian.shaun.thomas
  • 3,468
  • 25
  • 40

1 Answers1

3

The constant '5.1' is of type double. If you want a float, write 5.1f:

float test2 = rsRand(5.1f);
Codo
  • 75,595
  • 17
  • 168
  • 206