Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust modulus

//-21 modulus 4 => 3
((a % b) + b) % b	// a modulus b (workaround)
//-21 remainder 4 => -1
a % b	// a remainder b
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rust #modulus
ADD COMMENT
Topic
Name
2+3 =