Click here to Skip to main content
15,887,596 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Daniel Pfeffer13-Dec-22 22:17
professionalDaniel Pfeffer13-Dec-22 22:17 
GeneralRe: People still use Usenet? Pin
Jeremy Falcon14-Dec-22 11:53
professionalJeremy Falcon14-Dec-22 11:53 
GeneralRe: People still use Usenet? Pin
trønderen14-Dec-22 17:23
trønderen14-Dec-22 17:23 
GeneralRe: People still use Usenet? Pin
Daniel Pfeffer14-Dec-22 19:09
professionalDaniel Pfeffer14-Dec-22 19:09 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Member 916705714-Dec-22 21:20
Member 916705714-Dec-22 21:20 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Daniel Pfeffer14-Dec-22 22:30
professionalDaniel Pfeffer14-Dec-22 22:30 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Member 916705714-Dec-22 22:33
Member 916705714-Dec-22 22:33 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Daniel Pfeffer15-Dec-22 0:23
professionalDaniel Pfeffer15-Dec-22 0:23 
Member 9167057 wrote:
've studied physics

By a strange coincidence, so did I. I also studied Numerical Analysis.

The issue here is that Pi cannot be represented to adequate accuracy using IEEE 754 types. This has implications for argument reduction, e.g. for the trigonometrical functions.

If the closest representation of Pi in IEEE 754 is Pi+dPi, the argument reduction for a value x will calculate x' = x - 2 * N * (Pi + dPi), giving a reduced argument that is in error by at least 2 * N * dPi. This can be significant even for small values of N, e.g. around the zeroes of a function. It is possible that not even the sign of the calculated result is correct!

Some mitigations are possible, e.g. representing Pi as a sum of a few parts, but for large N the only fix is to use a highly precise form of Pi.

I enclose a link to an article that discusses this issue in more detail than most people will ever need... https://redirect.cs.umbc.edu/~phatak/645/supl/Ng-ArgReduction.pdf
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Member 916705715-Dec-22 0:53
Member 916705715-Dec-22 0:53 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Peter Moore - Chicago15-Dec-22 0:48
Peter Moore - Chicago15-Dec-22 0:48 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Daniel Pfeffer15-Dec-22 3:58
professionalDaniel Pfeffer15-Dec-22 3:58 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
trønderen15-Dec-22 9:09
trønderen15-Dec-22 9:09 
GeneralRe: Converting Pi to binary: DON'T DO IT! Pin
Daniel Pfeffer15-Dec-22 13:09
professionalDaniel Pfeffer15-Dec-22 13:09 
GeneralElephant you: Microsoft, HP, and Mcafeces Pin
Dan Neely13-Dec-22 9:56
Dan Neely13-Dec-22 9:56 
GeneralRe: Elephant you: Microsoft, HP, and Mcafeces Pin
Single Step Debugger14-Dec-22 3:06
Single Step Debugger14-Dec-22 3:06 
GeneralRe: Elephant you: Microsoft, HP, and Mcafeces Pin
obermd14-Dec-22 5:46
obermd14-Dec-22 5:46 
RantEvery year, I have to print the labels for our Christmas cards. Pin
OriginalGriff13-Dec-22 8:52
mveOriginalGriff13-Dec-22 8:52 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
Mircea Neacsu13-Dec-22 9:09
Mircea Neacsu13-Dec-22 9:09 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
fgs196313-Dec-22 9:23
fgs196313-Dec-22 9:23 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
Mycroft Holmes13-Dec-22 11:32
professionalMycroft Holmes13-Dec-22 11:32 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
Daniel Pfeffer13-Dec-22 11:35
professionalDaniel Pfeffer13-Dec-22 11:35 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
DRHuff13-Dec-22 15:11
DRHuff13-Dec-22 15:11 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
Richard Deeming13-Dec-22 22:14
mveRichard Deeming13-Dec-22 22:14 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
Peter_in_278013-Dec-22 17:36
professionalPeter_in_278013-Dec-22 17:36 
GeneralRe: Every year, I have to print the labels for our Christmas cards. Pin
pkfox13-Dec-22 21:52
professionalpkfox13-Dec-22 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.