Changeset 2f08a55d in mainline for test/print/print1/test.c


Ignore:
Timestamp:
2005-09-03T14:16:25Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f6297e0
Parents:
544b4bf
Message:

Support for NaN and infinity in printf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/print/print1/test.c

    r544b4bf r2f08a55d  
    3232{
    3333        __u64 u64const = 0x0123456789ABCDEFLL;
     34        double d;
    3435        printf(" Printf test \n");
    3536        printf(" Q  %Q  %q \n",u64const, u64const);
     
    4849        printf(" E  %.10E %.8e (123456789.987654321e12 for precision 10 & 8)\n",123456789.987654321e12,123456789.987654321e12);
    4950        printf(" E  %.10E %.8e (987654321.123456789e12 for precision 10 & 8)\n",987654321.123456789e12,987654321.123456789e12);
     51        u64const =0x7fffffffffffffffLL;
     52        d =*((double *)((void *)(&u64const)));
     53        printf(" E  %.10E (NaN)\n",d);
     54        u64const =(0xfff0000000000000LL);
     55        d =*(double *)(void *)(&u64const);
     56        printf(" E  %.10E (-Inf)\n",d);
    5057        return;
    5158}
Note: See TracChangeset for help on using the changeset viewer.