# Usage of fmod?

THREAD CLOSED
 Thread Tools Search this Thread Display Modes
 11 November 2006 azshall ...But ours go to eleven.   portfolio Seth Hall Visual Effects Director Visceral Games San Francisco, USA Usage of fmod? The docs give little info on this MEL command, anyone have the time to explain what exactly this does and the proper way to use it OR use the data it returns? Seth share quote
 11 November 2006 smaragden Smaragden   Fredrik Brännbacka Technical Director Mad Crew Stockholm, Sweden This is in PHP, and i'm pretty sure it's the same. --------------------------------------------------------------------------------- fmod -- Returns the floating point remainder (modulo) of the division of the arguments Description float fmod ( float x, float y ) Returns the floating point remainder of dividing the dividend (x) by the divisor (y). The reminder (r) is defined as: x = i * y + r, for some integer i. If y is non-zero, r has the same sign as x and a magnitude less than the magnitude of y. PHP Code: ```  \$x = 5.7;   \$y = 1.3;   \$r = fmod(\$x, \$y);   // \$r equals 0.5, because 4 * 1.3 + 0.5 = 5.7  ``` --------------------------------------------------------------------------------- __________________ Fredrik Brännbacka | Technical Director ------------------------------------- mail: fredrik@madcrew.se web: http://www.madcrew.se Last edited by smaragden : 11 November 2006 at 09:31 PM. share quote
 11 November 2006 grantimus Frequenter   portfolio Grant Heath technical artist iWorlds Simulations Sandy, USA Fmod is used for finding the remainder in division problems. 5 / 3 could be thought of as 1.6666666666 or it could be thought of as 1 with a remainder of 2. Fmod is used for finding that remainder. So `fmod 5 3` would return 2. About the only time I use fmod is to figure out if a number is even or not. If `fmod \$someNumber 2` returns a zero then I know that number is even. If it returns anything else I know the number is odd. I'm sure it has other uses though. share quote
 11 November 2006 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote
 Thread Closed share thread

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured 2D     Featured 3D     CG Awards     Community Awards Main     News     General Discussion     Off Topic     Recruitment         Temp Job Board Challenges     Rival Crimson X Chaos     Education     Demo Reel     Portfolio Review GROUPS WIP ADVICE     Pro Select     Art Direction and Interviews     New 2D/3D Sketchbooks 2018     WIP 2D/3D & Animation         WIP/Critique: 3D         WIP/Critique: 2D             Speedpaints & Sketchbooks         WIP/Critique: Animation     Partners and Groups         Kitbash 3D Thunderdome         Collaborative Projects Autodesk     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax Tutorials & Tips         3dsMax Resources         3dsMax SDK and MaxScript         Plugins & Add-ons         Particle Flow     Mudbox Featured Gallery ZBrush     Featured Zbrush Gallery     Pixologic ZBrush     Keyshot     Marvelous Designer Texturing     Allegorithmic Substance         Substance Designer         Substance Painter         Substance Featured Gallery     Texturing XYZ     Mari     Marmoset Toolbag Software     Maxon Cinema 4D         Cinema 4D Resources     Side Effects Houdini     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion     Additional Software         Lightwave 3D             LW Resources             LW Tutorials         The Foundry Modo             The Foundry Time Travel Challenge         E-on Software Vue         Photoshop / Painter         Blender         3DCoat Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling         Modeling Challenge             Member Model Collection     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders         Lighting Challenges     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     VR/AR     Master Virtual Reality with BrioVR     Workstation Builds     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 07:09 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.