Skip to content

Selah.

Pause, and calmly think on that.

Menu
  • About
  • Free Gift
  • Highlights
  • The New Covenant
  • Thoughts
    • Personal Thoughts
    • Famous Thoughts
    • Random Thoughts
Menu

Tag: modulo

How to Round to Arbitrary Precision in any Programming Language

Posted on November 1, 2010November 19, 2010 by Shovas

How to Round to Arbitrary Precision in any Programming Language: an AMultiply your rounding number by 10^y where y is the precision to round to. Call your language’s built-in round() method on this number. Divide the result by 10^y. Easy peasy. It also makes it easier to implement different rounding methods because you’re always dealing with the digit at the same location in the number.

  • Share
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to email a link to a friend (Opens in new window) Email
Read more
  • The Seven Wonders of the Web
  • Universal Bisection Search Online Spreadsheet Tool
  • Thoughts From Reconstruction by M.J. Gallant – Notes
  • Thoughts From Reconstruction by M.J. Gallant – About the Author
  • Thoughts From Reconstruction by M.J. Gallant – One More Thing

bible book canada centos christ christian christmas church creation evolution faith family game genesis God gog good google government heart iracing jesus life linux lord love matthew music pc poem poetry quote racing romantical salvation science sim sin steam truth update video windows word YouTube

Log in
© 2025 Selah. | Powered by Superbs Personal Blog theme