Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird INT()
Message
From
31/03/2017 07:28:27
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
31/03/2017 07:24:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01649581
Message ID:
01649584
Views:
53
>>Hi!
>>
>>I have following code
>>
>>lnX = 0x100000000 -1
>>
>>?INT(lnx/16777216)
>>
>>
>>I have two instances of VFP running, with different SET status. Same machine.
>>
>>The one returns 256 the other 255. FLOOR() works the same way.
>>
>>
?10^6*(lnx/16777216)
>>returns 255999999.9 on both
>>
?10^6*(lnx/16777216)
>>returns 25600000.0 on both
>>
>>Any idea what setting causes this?
>>
>>Lutz
>
>Decimals.
>
>
>CLEAR
>
>LOCAL NumDecimals AS Integer
>LOCAL lnX AS Number
>
>m.lnX = 0x100000000 -1
>FOR m.NumDecimals = 0 TO 10
>	SET DECIMALS TO (m.NumDecimals)
>	? "Decimals to " + TRANSFORM(SET("Decimals")),INT(m.lnX/16777216),m.lnX/16777216
>ENDFOR
>
)ლ

What the ...
I always had the idea SET DECIMALS is for display?
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform