Computing.Net > Forums > Unix > Format specifier for long double

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Format specifier for long double

Reply to Message Icon

Name: shamim.tcs
Date: November 9, 2006 at 00:21:59 Pacific
OS: HP-UX
CPU/Ram: 256 MB
Product: HP
Comment:

How can I access long double data type in a C++ program on aCC compiler on HP-UX.

Sample code :

#include <stdio.h>
#include <stdlib.h>
int main()
{
long double l1 = 32.12345678 ;
long double l2 = 20.87654358 ;

printf ("Result l1 : %Le\n" , l1);
printf ("Result l2 : %Le\n" , l2);

long double l3 = l1 * l2;
printf ("Result : %Le\n" , l3);

long double l4 = l1 / l2;
printf ("Result2 : %Le\n" , l4);
return 0;
}

I tried format specifiers like '%Le' , '%lf'.. but no fruitful results..
Plz suggest proper one..


Shamim Ahmad



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


print columns from files ... Awk Help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Format specifier for long double

fmthard command www.computing.net/answers/unix/fmthard-command/4477.html

Need a driver for crystal CX4235-XQ3 www.computing.net/answers/unix/need-a-driver-for-crystal-cx4235xq3/531.html

clear command to c command www.computing.net/answers/unix/clear-command-to-c-command/7001.html