![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4
![]() |
Currency, Integer and Single Datatype
In VB does currency and integer datatype almost resemble the same thing?
What is the difference exactly? What is the actual use of the currency Data Type?
__________________
Visit: http://www.somaiya.edu |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
Generally, integers are 2-byte values from -32.768 to 32.767 ( signed integers ).
Instead, currency is a 8-byte value that is used for currency values with high precision. Their range is -922.3372036854775808 - 922.3772036854775807 |
|
|
|
|
|
#3 |
|
Expert Programmer
|
The important thing about the currency data type is that it will never lose/round digits as it is stored as a pure binary number in memory as opposed to a mantissa/exponent pair. A double precision float is actually accurate to a lower number of decimal places than it holds, which saves memory but would not be suitable for transaction & financial uses.
|
|
|
|
|
|
#4 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
lol. I personally favour 42. How long is a piece of (null terminated) string?
![]() |
|
|
|
|
|
#6 | |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
Quote:
That's it. |
|
|
|
|
|
|
#7 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
The "size" of an integer is purely implementation specific, a matter of definition related to a very limited set of circumstances. I suspect that your book actually tells you that, particularly if it was actually authored by THE Peter Norton. I don't wish to harp on this unduly, but one must BE CAREFUL with information they impart. There is no sin in accompanying your information with caveats and qualifications because absolutes are so rare. It is, indeed, usually better that one do so.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
Ok, nevermind as always, probably you are right... I give up...
|
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I perceive that your feelings are hurt. I apologize for that. It is my own personal desire that this forum serve primarily as a place that novices may receive accurate and useful answers to their questions. In all honesty, I have given out bum information. Probably we all have. I would still rather see a reasonable amount of care taken, despite the fact that the forum is not universally viewed in that light. This personal desire sometimes outweighs my desire to be socially acceptable to the membership as a whole.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
Homer answers his son's fearful question regarding social acceptance, "Son, social acceptance is the most important thing in life!"
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty Last edited by stevengs; Oct 16th, 2005 at 4:42 PM. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|