flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
HaHaAnonymous 21 Dec 2013, 03:08
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:00; edited 1 time in total |
|||
![]() |
|
dogman 21 Dec 2013, 18:01
No! BCD representations of decimal values are EXACT. Binary is an approximation of decimal values. If you do money calculations with floating point expect to lose your ass in court at some point.
|
|||
![]() |
|
baldr 21 Dec 2013, 18:23
dogman,
In integer domain, they're equivalent. Rational numbers are harder (1/5 can't go binary, 1/3 isn't expressible by BCD too). |
|||
![]() |
|
dogman 22 Dec 2013, 16:11
That's why I said "BCD representations of decimal values are EXACT." Please read before disagreeing
![]() |
|||
![]() |
|
bipocich 22 Dec 2013, 21:34
HaHaAnonymous, THX for your response
![]() Yes, multiplying BCD ![]() Quote: Isn't better to convert it to binary, multiply and then convert it to BCD again? Good idea, if you help me to implement it(code), I will be happy ![]() Spox, HaHaAnonymous - no problem ![]() |
|||
![]() |
|
bipocich 22 Dec 2013, 21:40
dogman, THX for your response and comments
![]() Quote: BCD representations of decimal values are EXACT Yes, it's true. Quote: If you do money calculations with floating point expect to lose your ass in court at some point. ??:> |
|||
![]() |
|
bipocich 22 Dec 2013, 21:49
baldr, THX for your response and attention
![]() |
|||
![]() |
|
bipocich 22 Dec 2013, 21:53
dogman, THX for your response and attention
![]() dogman, baldr and others, Can anybody help me in this forum, rather than to argue about bits??XD THX. |
|||
![]() |
|
revolution 22 Dec 2013, 22:05
You can use the FBLD and FBSTP instructions to do the transfers to/from the FPU and perform the computations there. You can get a full 64-bits of precision that way.
Otherwise if you need more precision or don't want to use the FPU then there are AAA, AAD, AAM and AAS instructions for low density BCD coding. Plus DAA and DAS for higher density storage. IMO it is always easier to store numbers and values natively in binary and do computations natively. And then only for presentation purposes would you need to convert to some form of ASCII/BCD representation. |
|||
![]() |
|
baldr 23 Dec 2013, 00:10
bipocich wrote: dogman, baldr and others, Show us some efforts; nobody wants to do your homework instead of you, but somebody will help if you'll behave appropriately (i.e. present compilable source, indicate exact location of the problem instead of "it doesn't work", confirm that you take some measures to solve that problem yourself). |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.