Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
2k views

GNU BC: “modulo” % with scale other than 0

If the scale is other than zero, calculations with %, such as 3%2 and 46%4, tend to output 0. How is the algorithm designed with the scale other than 0? bc scale=10 print 4%3 // output 0
1
vote
1answer
53 views

GNU BC: functions, if-clauses and returns

The questions are in the comments of the code: define f(x) { print x^2 } define g(x) { print x+2 } if(f(2)>g(1)) { print "it works" } 43 # Why 43 instead of the text "it works"? a=f(2) ...