Re: sin (M_PI)



Tim Prince wrote:
Adam wrote:
Hi,
I am using the following code:
printf("%g", sin(M_PI))
and getting 1.22461e-16 instead of zero.
Does anyone have any idea why, and what I can do about it?

As the other responders have pointed out, this is to be expected. If you had opened up your search engine, you surely would have found some close references.
As you haven't said anything about your goals for modifying this behavior, the suggestion about sinl(M_PIl) is as good as any, keeping in mind that default Windows behavior is for long double to be simply an alias for double.

This is wrong. The lcc-win32 compiler features full precision (80 bits
floating point) for long double. The long double equals double
feature is just a feature of one compiler system under windows:
Microsoft MSVC. Other compilers under windows offer more precision.

jacob
.



Relevant Pages

  • Re: How to remove the parasite, popupsearches.com?
    ... See Tip to clean up your PC. ... What to Know Before You Download and Install Windows XP Service Pack 2 ... Why you should use a computer firewall.. ... The system restore feature is a new one - first appearing in Windows ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Important Files Security, etc.
    ... "HiLite" feature exposes differences between the two files. ... or changed files in your hard disk drive. ... Comes with a simple procedure to backup and restore your Windows system ... "PKZIP/UNZIP" for Dos will restore the Windows system to exactly the way ...
    (alt.computer.security)
  • Re: The Case is Altered
    ... daisy chaining a monitor's power supply. ... by Symantec Ghost cloning the original disc to a new disc. ... a swivel feature. ... Windows Explorer won't let you do. ...
    (uk.local.surrey)
  • The Case is Altered
    ... daisy chaining a monitor’s power supply. ... by Symantec Ghost cloning the original disc to a new disc. ... a swivel feature. ... Windows NT, see if you can cadge copies of files WINFILE.EXE, ...
    (uk.local.surrey)
  • Re: Windows is moving my files, tell him to stop. ;)
    ... Norton and my sound card driver fighting. ... I do like to play with all of the settings in Windows. ... folder do you want.) ... was talking about an advanced feature of Windows ...
    (microsoft.public.windowsxp.general)