# Using float number more than 10 digit

 10 October 2017 jabermax2 PRO portfolio Jaber Zaker Joybari Iran Using float number more than 10 digit Hi everybody If i need a number more than 10 digit like  (  a = 0.12345678910  ) how should i do that ? formattedPrint of the number will show more accurate number but it is in string and if i execute the string again it get back to normal number. share quote
 10 October 2017 Archangel35757 Expert portfolio Michael Lawler Engineer Madison, USA what you want exceeds the accuracy/precision for floats.  And if I recall correctly, maxscript by default prints floats out to 6 decimal places... to go beyond that is pointless. share quote
 10 October 2017 PolyTools3D Expert   portfolio Jorge Rodríguez Argentina 3DS Max does support double float precision since a long time ago. However, as soon as you do some "real" stuff, everything is rounded to float.   But you can do your math using double values and then use the result to do some other stuff. It should be more precise than using float values. `````` (     a = double 0.000000001     b = double 0.000000001     format "DOUBLE: %\n%\n\n" (a+b) (formattedprint (a+b) format:".10f")          a = float 0.000000001     b = float 0.000000001     format "FLOAT: %\n%\n\n" (a+b) (formattedprint (a+b) format:".10f") )`````` __________________ Jorge Rodríguez PolyTools3D share quote
 10 October 2017 PolyTools3D Expert   portfolio Jorge Rodríguez Argentina Here is a better example of working with float and double values. As you can see, cumulative errors are not minor and lead to very different results. `````` (     af = float 0.031565        -- 0.031565f     bf = float 0.015988        -- 0.015988f     cf = float 0.098796        -- 0.098796f          ad = af as double        -- 0.031565d0     bd = bf as double        -- 0.015988d0     cd = cf as double        -- 0.098796d0          f = 0f     d = 0d0          for j = 1 to 10000 do     (         f += af + bf + cf         d += ad + bd + cd     )          clearlistener()          format "CORRECT RESULT: 1463.49\n\n"     format " FLOAT: %\t\t<- WRONG\n%\n\n"   (float f) (formattedprint f format:".10f")     format "DOUBLE: %\t\t<- CORRECT\n%\n\n" (float d) (formattedprint d format:".10f")          delete objects          box pos:[f,f,f] wirecolor:red        -- Less accurate     box pos:[d,d,d] wirecolor:green        -- More accurate          max zoomext sel all )`````` __________________ Jorge Rodríguez PolyTools3D share quote

 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.
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Community Awards     Featured 2D     Featured 3D     Latest Entries     CG Awards Main     News     General Discussion     Featured Videos     Education     Off Topic     Recruitment         Temp Job Board Challenges     The Next Challenge     Lighting Challenges     Professional Feedback GROUPS WIP ADVICE     New 2D/3D Sketchbooks 2018     Art Direction and Interviews     WIP 2D/3D & Animation         WIP/Critique: 3D         WIP/Critique: 2D             Speedpaints & Sketchbooks         WIP/Critique: Animation     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     Mari     Texturing XYZ     Marmoset Toolbag     3DCoat     Allegorithmic Substance         Substance Designer         Substance Painter         Substance Featured Gallery Software     Maxon Cinema 4D         Cinema 4D Resources     The Foundry Modo         The Foundry Time Travel Challenge     Side Effects Houdini     Lightwave 3D         LW Resources         LW Tutorials     Blender     Photoshop / Painter     E-on Software Vue     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion 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     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     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 12:39 AM.