Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 16th, 2005, 1:02 AM   #1
java_roshan
Professional Programmer
 
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4 java_roshan is on a distinguished road
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
java_roshan is offline   Reply With Quote
Old Oct 16th, 2005, 4:29 AM   #2
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
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
ivan is offline   Reply With Quote
Old Oct 16th, 2005, 10:35 AM   #3
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Oct 16th, 2005, 11:49 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
Generally, integers are 2-byte
Please conduct a survey to determine the applicability of this statement.
__________________
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
DaWei is offline   Reply With Quote
Old Oct 16th, 2005, 2:13 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
lol. I personally favour 42. How long is a piece of (null terminated) string?
Rory is offline   Reply With Quote
Old Oct 16th, 2005, 3:38 PM   #6
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Quote:
Originally Posted by DaWei
Please conduct a survey to determine the applicability of this statement.
Three years ago, I bought a Piter Norton book for Visual Basic 6.0. I heared that it is a very good book, so I looked in and found about data types in vb.
That's it.
ivan is offline   Reply With Quote
Old Oct 16th, 2005, 3:45 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 16th, 2005, 3:59 PM   #8
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Ok, nevermind as always, probably you are right... I give up...
ivan is offline   Reply With Quote
Old Oct 16th, 2005, 4:17 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 16th, 2005, 4:22 PM   #10
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by DaWei
..desire sometimes outweighs my desire to be socially acceptable..
:p :p

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.
stevengs is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:58 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC