Closed depler closed 2 years ago
There is no direct way to do it, but you can do it like this:
bc.exe -e "scale = 100" -f-
-e
is the command-line option to take expressions, and since bc
exits by default when giving it an expression, you add -f-
to tell it to also accept input from stdin
.
I think next release, I will add the ability to not exit by default on expressions for Windows. (FreeBSD wants my bc
to exit by default.) Once I do that, you will be able to do:
bc.exe -e "scale = 100"
Well, this is not really an option for me - I want bc to exit after -e
switch. The point is to have ability to manipulate of scale value from outside - the only option for now to do it is within a script or command. Anyway, not really a problem. Fell free to close this, if you are not going implement scale switch.
Yeah, I'm sorry. It's a little too specialized to do in my opinion.
Thank you for understanding.
@depler would you still want this? I'm going to do a release soon, and I'm reconsidering it.
@depler I'm going to implement this.
It is now implemented in 488d48c87c5b9e02e5c3911918c2d6d7687246e8. The command-line options are -S
/--scale
, -I
/--ibase
, -O
/--obase
, and -E
/--seed
.
If you could test before I release 5.3.0
, I would appreciate it.
Also, history is working on Windows now!
It's been released in 5.3.0
. Hope this helps!
Is there any command line switch to set scale at start, like
bc.exe --scale 100
? If not, could you please implement?