mozaic_tips_and_tricks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 _kimozaic_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:
  
 <code> <code>
-  maxB = 1000  // Maximum value for plus one +  maxA = 1000  // Maximum value for plus one 
-  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 
 </code>  </code> 
  
 To later extract the values from their packed format use To later extract the values from their packed format use
 <code> <code>
-  valA = RoundDown combinedValue / maxB +  valA = combinedValue % maxA 
-  valB = combinedValue % maxB+  valB = Div combinedValue, maxA
 </code> </code>
 \\  \\ 
  • mozaic_tips_and_tricks.txt
  • Last modified: 2024/04/23 19:07
  • by _ki