|
Chris Losinger wrote:
Foley and Van Damme's book on graphics is one of the standards
Okay , it so appears
Adding it to wishlist .... done ... 100% processed
Thanks Chris
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
LONG first = 1022230205L;
LONG second = 1000L;
LONG third = first * second;
cout << third << endl;
This should result in 1022230205000 but it returns 27988552 instead. Am I missing something here?
I've tried DWORD also, same result.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The largest LONG is 2147483647, so your calculation causes an overflow.
|
|
|
|
|
Could be something like that. But I've tried DWORD as well.
I thought that the maximum was 9.223.372.036.854.775.807
The maximum you gave is for integers, no?
Can a long be negative?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The maximum value of a DWORD is 4,294,967,295. You're having an overflow.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry guys.
I've noticed that a long only uses 4 bytes.
I'm a java programmer and a long is 8 bytes in java
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
why have you put an L at the end of the numbers? could that be the problem?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
If you don't put the L, the compiler assumes that's an integer. We add the L to reserve a bigger memzone.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
oh...didnt know that
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
I don´t think that the L will reserve a bigger memzone.
It only says the compiler that the number is to been seen as long, a typ-cast.
Try to trace every variable after assign it!!
|
|
|
|
|
You've overflowed the LONG. Try __int64.
|
|
|
|
|
Why do all the languages take there very own amount of bytes for the data types? java-long=8 <-> c++long=4 ...
Very confusing
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Type sizes in C++ are implementation-dependant. The standard only dictates the minimum size. However, for most (all?) 32-bit compilers, sizes are just like in VC++.
The next version of C++ standard most likely will include types with fixed size, like int32 , int64 etc., to aid in the developing of cross-platform code.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
If I use a double, that will do too?
A double is 8 bytes, msdn says so.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
double is not integer, but floating point
use hyper
|
|
|
|
|
I'm curious as to why you are adverse to using __int64?
|
|
|
|
|
I'm writing dirty-java at the moment, that's something like a combination of java and c++ through jni (java native interface).
and the __int64 doesn't exist there. But it works if you put the c++ calculation in a double and when returned to java cast it back to a (8bytes) long.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Is the 8bytes long an integer or floating point?
If integer, then a java long IS an __int64. If floating point, then it is the same as a double in C.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
It's no floating point.
The range for long is this:
[-9.223.372.036.854.775.808,9.223.372.036.854.775.807]
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
As far as I know the __int64 is just an 8 byte value (hince the 64). You should be able to just as easily case __int64 to java long as a double. Also, double is a C++ intrinsic type which means that if you use it in your C++ it is going to be interperted as a floating point value.
good luck.
|
|
|
|
|
You can cast it to double AND long. But the double uses floating point notation and that's no good if you're coding front-end.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
How can i use file handling in ATL ActiveX
I tried _open and other functions but it says
unresolved symbol to _main
Please help
Sameer
|
|
|
|
|
_open uses the CRT so you need to remove the ATL_MIN_CRT flag.
|
|
|
|
|
If you're familiar with STL, iostreams will do the job well.
|
|
|
|