Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The old issue ( bug ) on ROUND() function
Message
From
14/01/2005 09:30:27
 
 
To
14/01/2005 07:55:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00977091
Message ID:
00977183
Views:
22
>>Run this:
>>
>>CLEAR
>>FOR K=3 TO 15
>>    x=ROUND(ROUND(147.325,m.k),2)
>>	? m.k	,	m.x
>>NEXT
>>
>>
>>First new VFP10 behaviour to implement:
>>DECIMAL(N,M) datatype.
>>with INTEGER 64 or INTEGER 128 format
>>
>>Fabio
>
>... or packed decimal (BCD). Come to think of it, there would hardly have to be any restriction to the size.

No, BCD is a inefficient coding.
( when IBM defines it, the IBM's CPU they had instructions machine in order to execute BCD calculations)

On VFP is possible implement:
DECIMAL(1..9,1..9)    with a INT32
DECIMAL(1..18,1..18)  with a INT64
DECIMAL(1..28,1..28)  with a INT96
DECIMAL(1..38,1..38)  with a INT128
of course when you write:
x=3.0
* on VFP9 x is a B(1)
* on VFP10 x is a DECIMAL(9,1) or DECIMAL(SET("somesetproperty"),1)
* and this can be a issue
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform