Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
testing a number's quare root is an integer and casting to a value?
#6
What is Mod 1 ?
Code: (Select All)
For i = 1 To 10

    MySquareRoot! = Sqr(i)

    Print i, MySquareRoot!, MySquareRoot! Mod 1, _IIf((MySquareRoot! Mod 1 = 0), "Integer", "Not Integer")
Next

looks like mod 1 = 0 for everything!

I give the testing of a number as an integer with Mod 1, a mod 1 rating. Smile


From Wiki:
Quote:What is mod 1 in math?
The range of values for an integer modulo operation of n is 0 to n − 1. a mod 1 is always 0. When exactly one of a or n is negative, the basic definition breaks down, and programming languages differ in how these values are defined.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: testing a number's quare root is an integer and casting to a value? - by bplus - 01-27-2025, 11:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Maximum Number of Attachments per Thread Magdha 7 483 01-13-2026, 10:13 AM
Last Post: Magdha
  getting the number of dimensions in an array on the fly? madscijr 7 752 09-16-2025, 12:34 AM
Last Post: madscijr
  Random Number Generator pmackay 14 1,274 07-30-2025, 12:56 PM
Last Post: SMcNeill
  Illegal string-number conversion Herve 7 775 07-07-2025, 09:53 AM
Last Post: a740g
  Why are SINGLE variables faster than INTEGER variables ? Elzaimer 18 2,380 07-07-2025, 05:01 AM
Last Post: ahenry3068

Forum Jump:


Users browsing this thread: 1 Guest(s)