Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
mozaic_tips_and_tricks [2020/01/12 21:16] – [Store two positive Values into a single Variable] Fixed typo _ki | mozaic_tips_and_tricks [2020/01/12 21:22] – [Store two positive Values into a single Variable] Updated sample code to use Div instead of RoundDown _ki | ||
---|---|---|---|
Line 70: | Line 70: | ||
< | < | ||
- | | + | |
- | valA = 723 // allowed range 0 .. ~16000 | + | valA = 723 // allowed range 0 .. 999 |
- | varB = 124 // allowed range 0 .. 999 | + | varB = 124 // allowed range 0 .. ~16000 |
| | ||
- | combinedValue = valA * maxB + valB | + | combinedValue = valA + valB * maxA |
</ | </ | ||
To later extract the values from their packed format use | To later extract the values from their packed format use | ||
< | < | ||
- | valA = RoundDown | + | valA = combinedValue |
- | valB = combinedValue | + | valB = Div combinedValue, maxA |
</ | </ | ||
\\ | \\ |