SPLat Logo

fixToU n [D>=14]

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

fixToU n [D>=14]

Calculates the integer part of W and leaves it in U(n) - U(n+3) as a 24 bit signed number. This instruction is intended primarily for use with Tiny Serial Peripheral (TSP) data types Word and Long.

Although the result is in 32 bits the current implementation is limited to numbers in the range -8,388,607 to +8,388,607 (signed 2's complement 24-bit values, sign extended into the most significant byte).

Limiting cases:

See also result codes

(This is in keeping with the principle of non-stop computing. It is your responsibility to check for extreme cases if anything bad might otherwise happen.)

Do not confuse with fix, which is the "classic" conversion of floating point in W to integer in X.

Dialect restriction: Available only in boards with dialect 14 or greater.

See also floatFromU