Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Random Not Returning a number?

I was playing with SRP_Math("Random", e.g., Result = SRP_Math('RANDOM', 1, 6000). It returns a number, but OI doesn't think so. For example, Result = 2814.258660440446841, however, when I pass Result to the Int function. It tells me that it's not a numeric Int( Result) . Also, when I test Result with Num function, it also comes back that Int( Result) isn't a number. However, if I explicitly type in the number into the Int function, it works. Any ideas?

Comments

  • Ray,

    I can only assume that OI is having trouble with long floating point decimals or perhaps the number is being converted to scientific notation and this is causing issues. My suggestion is to try using the SRP_Math INT service or set the DecimalPlaces argument in the RANDOM service to be 0.
  • Hey Don,
    That worked great. OI must have a problem with long floating point numbers.

    Thanks for the suggestions. They worked!
  • Ray,

    It's fairly well known that OI does have floating point number limits (16-digits) due to the 32-bit architecture. That's why we created SRP_Math. I was speculating that the random number you got was too long for OI's native statements and I think your further testing showed that to be the case.
  • Well, well known to you :-)

    Thanks for the SRP_Utility. I have found some very useful things within and has really helped. Also, as always, appreciate your prompt replies and expertise.

  • LOL. Well, perhaps you didn't know the details, but I suspect you know the basics. After all, you are definitely well aware of the old 64K limit of AREV and OI 16-bit. It's just requires a little bit of extrapolation to realize that 32-bit systems (and 64-bit systems...and so on) all have an upper limit. If it helps, I had to re-read our own SRP Math home page to cite the limit. :)
  • What a man! I wish all you Donald's could be so humble.

    Have a great day in cool Oregon.
Sign In or Register to comment.