CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2013
    Posts
    31

    C++ SSE and SSE2 compiler settings, and their Floating Point effects

    I have been running C++ floating point tests using the
    Twilight Dragon Media C++ compiler for 64 bit Windows 10.

    https://jmeubank.github.io/tdm-gcc/


    C++ starts by using IEEE 754 equation for floats and doubles,
    decimal and hexadecimal values, floating point arithmetic,
    if I have things right. See this at:

    https://introcs.cs.princeton.edu/java/91float/


    I have learned that when you compile in
    Code:
    A)
    float a = 0.1F;
    what you get is stored is

    0.100000001490116119384765625


    whereas when you compile in

    HTML Code:
    B)
    double b = 0.1D;
    what you get stored is

    0.1000000000000000055511151231257827021181583404541015625


    Most of your floating point operators are these:

    +, -, *, /, %, ++n, --n, n++, n--, +=, -=, *=, /=, %=


    Is there a GNU C++ switch that will turn off all of these floating point overflow
    and underflow values, both for assignment of the floating point data and
    arithmetic operator calculation for separate floating point data, too? How can
    this be acheived without adjusting the floating point source code at all?
    Last edited by Zachary1234; May 31st, 2022 at 05:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured