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:10] – Updated overview _kimozaic_tips_and_tricks [2020/01/12 21:16] – [Store two positive Values into a single Variable] _ki
Line 70: Line 70:
  
 <code> <code>
-  offset = 1000  // Maximum value for B plus one +  maxB = 1000  // Maximum value for B plus one 
-  valA   = 723   // allowed range 0 .. ~16000 +  valA = 723   // allowed range 0 .. ~16000 
-  varB   = 124   // allowed range 0 .. 999+  varB = 124   // allowed range 0 .. 999
      
-  combinedValue = valA * offset + valB+  combinedValue = valA * maxB+ valB
 </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 / offset +  valA = RoundDown combinedValue / maxB 
-  valB = combinedValue % offset+  valB = combinedValue % maxB
 </code> </code>
 \\  \\ 
  • mozaic_tips_and_tricks.txt
  • Last modified: 2024/04/23 19:07
  • by _ki