Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
olback107947yWhen would you need that kind of precision? I mean a double only has 11 bits of exponent. https://stackoverflow.com/questions...
-
dmonkey21957y@SpaceBearOne There is
@potluck you're right if you need each of them one by one, but for calculations so many digits are useless... 10 decimal digits should be ok for a simple but accurate program... I think -
@dmonkey 15-16 is about as accurate as you'll ever need.
For most programs tho, 7-8 is more than plenty. -
Reminds me of my high school physics course, where a class mate liking accuracy always put all decimals his calculator would give. My teacher went so far as to retract points, because the input data had less significant digits.
-
hexc11197yI do a lot of math while programming, use Pi all over but I've only ever needed it at double precision or lower, and usually can get away with just floating point.
-
You literally only need 39 digits to measure the observable universe. That's accurate enough to within a single hydrogen atom's width.
This guy is just trying to show off now. -
bioDan56227y@iSwimInTheC what if you want to make measurements in the microscopic universe or even the quantum universe where thise digits of pi are more significant?
All im saying is that there could be a valid arguments as to why it woulda
be better to store the data rather than calculate it. Its the classic "calculation" vs "retrival time" methods of implementation. Each one can be better depending on the goals and implementations behind the code. -
Why not ask him about it? Maybe he had an out of the box idea for using it. Sometimes genius is indistinguishable from crazy. :p
-
bioDan56227yYes @beleg but when 20k users a day query your machine-on-a-cloud for a complicated calculation, calculating pi each time will be cpu intensive which will result in higher costs in terms of time and money.
It would be more cost effective and potentially faster to store the value in the disk or db once, and in memory during run-time.
Afterall it's not likely that the value of pi is gonna change anytime soon 😁 -
wizzzard8057y@bioDan but how can you be SURE, without calculating it every single time? Maybe some fundamental law of math suddenly gets patched/updated automatically by Windows 10 to a new version, and all your other math is off because you used a hardcoded value for pi... 🤡
-
Trust me, just an arcane secret of sacred geometry just for summon some poop.
*sarcasm*
Yup, pardon the low-cursery-level. -
-vim-31257yActually, you’re better of saving binary π, except if you are doing base 10 calculation
-
This is what happens when chemists learn to code.
I kid you not. I worked with a guy that wanted 0.1 inch precision during testing on a system that an error of +/- 1 inch with an allowed error of 6 inches.. Fuck chemists.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
micheltombroff36Another programming job: the first 5,183 decimals of pi, in wood sticks. Took me three months to do. Now I sta...
Was helping somebody with a little C++ issue (disclaimer: I know jackshit about C++).
After a while off reading his code and opening a file called "pi.cpp", I noticed something odd...
This guy literally thought is was a good idea to put 81663 fucking decimals of pi in a #define statement :^)
On the screenshot, that weird "noise" on the right is actually a scrollbar of the code itself...
rant
pi
c++
whateven?