473,486 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

printf and 'long double'

I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error
Jul 23 '05 #1
4 2213
saper wrote:
I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error


What error?
Jul 23 '05 #2
saper wrote:
I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error

Unfortunately, MINGW has problem with long double. It is a compiler bug,
which probably is not going to be fixed too.

Consult MINGW users mailing list if you want to more information on this
and to discuss it more.


--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #3
Thanks
but when I use
cout << ld
It is OK
"Ioannis Vranos" <iv*@remove.this.grad.com> wrote in message
news:1109326105.127718@athnrd02...
saper wrote:
I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error

Unfortunately, MINGW has problem with long double. It is a compiler bug,
which probably is not going to be fixed too.

Consult MINGW users mailing list if you want to more information on this
and to discuss it more.


--
Ioannis Vranos

http://www23.brinkster.com/noicys

Jul 23 '05 #4
saper wrote:
Thanks
but when I use
cout << ld
It is OK

It isn't for much large values:
#include <limits>
#include <cfloat>
#include <iostream>
int main()
{
using namespace std;

long double ld= numeric_limits<long double>::max();

cout<<ld<<"\n";
ld= LDBL_MAX;

cout<<ld<<"\n";
}
C:\c>temp
1.#INF
1.#INF

C:\c>

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
22899
by: Piotr B. | last post by:
Hello, I use MingGW g++ 3.2.3 on Windows 2000/AMD Athlon XP. I tried to output a "long double" variable using stdio printf(). I've tried various %formats (%llf, %Lf etc.), but none of them...
2
3487
by: Paul E Johnson | last post by:
Dear friends in C: I'm completely baffled by this problem I have with printf statements and conditional operators in C. I'm using gcc-3.3. I have a project where the rarely used Union type...
13
3875
by: Yogesh Khanolkar | last post by:
Hi, I am getting incorrect o/p from the code below: #include<stdio.h> #include<float.h> #include<limits.h> main() { double val,val1;
3
3207
by: Hans Ginzel | last post by:
Hello, let us consider function int foo(char *name, void *data) { ... printf(name, data); /* Should be *data? */ ... }
7
2521
by: sunfiresg | last post by:
During an interview, I am asked to answer a question: Printf is a major formatted output function provided by the standard C library. Printf accepts a formatting string followed by a various...
2
2292
by: Jude | last post by:
here is the source code: #include<stdio.h> int main() { float f; scanf("%d%f",&f); printf("The float is %10.5f\n",f); return 0; } when I input 12345.11111,the output is 12345.11133.
69
5488
by: fieldfallow | last post by:
Hello all, Before stating my question, I should mention that I'm fairly new to C. Now, I attempted a small demo that prints out the values of C's numeric types, both uninitialised and after...
12
43393
by: Zero | last post by:
Hi everybody, i want to write a small program, which shows me the biggest and smallest number in dependance of the data type. For int the command could be: ...
11
3876
by: timmu | last post by:
Someone asked me a question about integer division and printf yesterday, I tell him he should do a casting to float/double before you do any interger division. But he doesn't think so, so I try...
17
2464
by: arindam.mukerjee | last post by:
I was running code like: #include <stdio.h> int main() { printf("%f\n", 9/5); return 0; }
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.