long-double Questions

4

Solved

I know that size of various data types can change depending on which system I am on. I use XP 32bits, and using the sizeof() operator in C++, it seems like long double is 12 bytes, and double is 8....
Spaetzle asked 11/8, 2010 at 0:55

0

I'm just starting to learn C moving from C++, and I was just trying out a ton of variable types. I am using the MingGW-w64 toolset with the GCC compiler. This version supposedly uses UCRT runtime i...
Allomerism asked 12/1 at 13:8

0

64 bit architecture like x86-64 have word size of 64bits. In this case, if a memory access crosses over the word boundary, then it will require double the time to access data. So alignment is requi...

6

Solved

I was looking at another question (here) where someone was looking for a way to get the square root of a 64 bit integer in x86 assembly. This turns out to be very simple. The solution is to conver...
Penner asked 28/8, 2013 at 22:44

3

Solved

EDIT: After some discussion in the comments it came out that because of a luck of knowledge in how floating point numbers are implemented in C, I asked something different from what I meant to ask....
Vanwinkle asked 15/1, 2021 at 16:41

2

How to get a Python long double literal? I have tried with numpy.longdouble(1e309) and numpy.longdouble("1e309") but both of them just return inf. What would be the right way to do that? [...
Proselyte asked 8/4, 2016 at 16:30

4

Solved

Consider this program: #include <stdio.h> union myUnion { int x; long double y; }; int main() { union myUnion a; a.x = 5; a.y = 3.2; printf("%d\n%.2Lf", a.x, a.y); return 0; } Out...
Beetlebrowed asked 20/9, 2019 at 17:53

8

Solved

I am using the latest gcc with Netbeans on Windows. Why doesn't long double work? Is the printf specifier %lf wrong? Code: #include <stdio.h> int main(void) { float aboat = 32000.0; doub...
Triecious asked 3/11, 2010 at 16:20

4

Solved

What is the actual precision of long double on Intel 64-bit platforms? is it 80 bits padded to 128 or actual 128 bit? if former, besides going gmp, is there another option to achieve true 128 prec...
Calliper asked 10/5, 2010 at 0:11

2

From https://en.wikipedia.org/wiki/Long_double: In C++, long double refers to a floating-point data type that is often more precise than double-precision. However, as with C++'s other floating-poi...
Achates asked 11/10, 2018 at 14:42

4

Solved

Consider the following C code: #include <stdio.h> int main(int argc, char* argv[]) { const long double ld = 0.12345678901234567890123456789012345L; printf("%lu %.36Lf\n", sizeof(ld), ld);...
Tuque asked 29/6, 2013 at 17:29

4

Solved

I'm looking for detailed information on long double and __float128 in GCC/x86 (more out of curiosity than because of an actual problem). Few people will probably ever need these (I've just, for th...
Adamandeve asked 22/11, 2012 at 16:7

0

I have the following function in my code that checks numbers for having allowed values (in log space): template<class T> static void check_if_normal(T t) { T additive_neutral_element = make_...
Breakwater asked 21/5, 2017 at 21:37

1

Solved

I'm trying to compute a series using C++. The series is: (for those wondering) My code is the following: #include <iostream> #include <fstream> #include <cmath> // exp #includ...
Devote asked 20/3, 2017 at 15:53

5

I've been reading the C Primer Plus book and got to this example #include <stdio.h> int main(void) { float aboat = 32000.0; double abet = 2.14e9; long double dip = 5.32e-5; printf("%f c...
Blandishment asked 22/11, 2009 at 15:36

5

Solved

Yeah, I meant to say 80-bit. That's not a typo... My experience with floating point variables has always involved 4-byte multiples, like singles (32 bit), doubles (64 bit), and long doubles (which ...
Carnivore asked 4/3, 2009 at 21:25

1

Solved

I am trying print a simple long double, but it doesn't work What I tried: long double ld=5.32; printf("ld with le = %Le \n",ld); printf("ld with lf = %Lf \n",ld); printf("ld with lg = %Lg \n",ld...
Serrell asked 10/10, 2014 at 9:24

1

I am trying to work with the np.longdouble dtype in my Python code, and am trying to use NumPy to manipulate long doubles that I get from a C module compiled with Cython. Suppose I do this: impor...
Unflinching asked 25/8, 2014 at 7:33

1

Solved

I apologize in advance for my poor knowledge of C: I use Python to code and have written a few modules with Cython using the standard C functions to effect a great increase in speed. However, I nee...
Cayenne asked 19/8, 2014 at 9:31

5

Solved

I'm still a beginner at programming and I always have more questions than our book or internet searches can answer (unless I missed something). So I apologize in advance if this was answered but I ...
Foe asked 11/7, 2013 at 21:34

4

Solved

What is the most portable and "right" way to do conversion from extended precision float (80-bit value, also known as long double in some compilers) to double (64-bit) in MSVC win32/win64? MSVC cu...

3

Solved

For specifics I am talking about x87 PC architecture and the C compiler. I am writing my own interpreter and the reasoning behind the double datatype confuses me. Especially where efficiency is co...
Danaus asked 21/4, 2012 at 3:47

3

Solved

Possible Duplicate: long double vs double I am new to programming and I am unable to understand the difference between between long double and double in C and C++. I tried to Google it but...
Shakitashako asked 8/1, 2013 at 18:26

2

Solved

This question may sound like for beginners, however when I found that out I thought I'm either a beginner or my comp is missing something: int main() { cout << sizeof(double) << endl;...
Instructions asked 19/1, 2012 at 7:3

1

Solved

A while ago I wrote a program which used some factorial functions. I used the long double data type to support "relative" big numbers. Now, I changed from codeblocks to Visualstudio 2010, I...
Caught asked 19/8, 2011 at 11:10

© 2022 - 2024 — McMap. All rights reserved.