generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Approixmaition/Around x number identifier?

Previous Thread :: Next Thread 
virulent_phantom is not online. virulent_phantom
Joined: 13 Jun 2011
Total Posts: 470
09 Jul 2016 02:38 PM
so you can do
x == 10 which means if x is absolutely equal to 10
you can do
x ~= 10 which means if x is any value BUT 10
and i think you know greater than, or greater than or equal to, blah blah

is there any identifier to know if x is close to that number

i.e

--let say x's value is 9.999999 or 10.10235556667
if x ?? 10 then
--code
end

is there anything like this?
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
09 Jul 2016 02:41 PM
"close" is a relative term

only you know what you mean by "close" and you can make your own function for it

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
09 Jul 2016 02:42 PM
math.floor or math.ceil


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
09 Jul 2016 02:43 PM
if math.abs(val-10) <= 0.01 then

Change 0.01 to what you want the maximum error to be.
Report Abuse
virulent_phantom is not online. virulent_phantom
Joined: 13 Jun 2011
Total Posts: 470
09 Jul 2016 02:48 PM
thanks guys
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image