Search Results

Search: Posts Made By: garethsays
1,479
Posted By Lucas_0418
Founded that your need a minimum number, it...
Founded that your need a minimum number, it frustrated me.
$ awk '{a[NR]=$0}$2=="1"{p=s+1;s=NR;for(i=p;i<=s;i++){if(p==1){print a[i]","s-i}else{x=i-p+1<s-i?i-p+1:s-i;print a[i]","x}}}' FS=',' file...
4
BC
1,652
Posted By methyl
Building on the above brilliant ideas, I think I...
Building on the above brilliant ideas, I think I have got there:

for usr_input in -3 -4 -24 -27 -28 -48
do
echo "((( $usr_input -23 ) % -48 ) -1 )"|bc
done

-27
-28
-48
-3
-4
-24
4
BC
1,652
Posted By cero
This looks more like a mathematical puzzle. ...
This looks more like a mathematical puzzle.
Gareth, are you looking for a bc expression that subtracts 24 from your input value and returns the remainder of the division by -48 unless the remainder...
Showing results 1 to 3 of 3

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