Search Results

Search: Posts Made By: FleetFoot
7,632
Posted By FleetFoot
Thanks drl, The Perl document says: ...
Thanks drl,

The Perl document says:

which covers this case and the result should be positive or "matching the divisor". As you point out, the Wikipedia table shows BASH gives the same sign as...
7,632
Posted By FleetFoot
Thanks Jim, I tried that and it made no...
Thanks Jim, I tried that and it made no difference:


echo "The result of A % B should be an integer in the range 0 to B-1, let's test it ..."
echo "(9-7) % 5 = $(( $(( 9 - 7 )) % 5 )) (should be...
7,632
Posted By FleetFoot
Newbie question: modulo operator with negative operand, bug or feature?
Hi,

I'm new to the Ash shell so my apologies if this is well known. In normal maths and other shells and languages I've used, the modulo operator always returns a positive remainder. For example...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 12:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy