• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setjmp/longjmp changed in Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setjmp/longjmp changed in Tiger


  • Subject: Re: setjmp/longjmp changed in Tiger
  • From: plumber <email@hidden>
  • Date: Sun, 29 May 2005 19:47:46 +0200

/*************************************************************/
#include <stdio.h>
#include <fenv.h>

int main(void)
{
  int save_rnd, rnd;
  double x, y, z;

  save_rnd = fegetround();
  if (save_rnd == FE_TONEAREST)
    printf("rounding direction is FE_TONEAREST\n");
  else
    printf("unexpected rounding direction\n");

  x = 1.79e308;
  y = 2.2e-308;
  z = x / y;                      /* overflow */
  printf("%g / %g = %g\n", x, y, z);

  x = -1.79e308;
  y = 2.2e-308;
  z = x / y;             /* negative overflow */
  printf("%g / %g = %g\n", x, y, z);

  fesetround(FE_TOWARDZERO);
  rnd = fegetround();
  if (rnd == FE_TOWARDZERO)
    printf("rounding direction is FE_TOWARDZERO\n");
  else
    printf("unexpected rounding direction\n");

  x = 1.79e308;
  y = 2.2e-308;
  z = x / y;                      /* overflow */
  printf("%g / %g = %g\n", x, y, z);

  fesetround(FE_UPWARD);
  rnd = fegetround();
  if (rnd == FE_UPWARD)
    printf("rounding direction is FE_UPWARD\n");
  else
    printf("unexpected rounding direction\n");
                                                /* continued */
/*************************************************************/
/*************************************************************/
  x = -1.79e308;
  y = 2.2e-308;
  z = x / y;             /* negative overflow */
  printf("%g / %g = %g\n", x, y, z);

/* return to round-to-nearest */
  fesetround(save_rnd);
  rnd = fegetround();
  if (rnd == FE_TONEAREST)
    printf("rounding direction is FE_TONEAREST\n");
  else
    printf("unexpected rounding direction\n");
}
/*************************************************************/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >setjmp/longjmp changed in Tiger (From: "David N. Williams" <email@hidden>)
 >Re: setjmp/longjmp changed in Tiger (From: Matt Watson <email@hidden>)

  • Prev by Date: Re: setjmp/longjmp changed in Tiger
  • Next by Date: Re: __builtin_frame_address()
  • Previous by thread: Re: setjmp/longjmp changed in Tiger
  • Next by thread: bless command and target mode
  • Index(es):
    • Date
    • Thread