mersenneforum.org > YAFU YAFU as a calculator?
 Register FAQ Search Today's Posts Mark Forums Read

 2021-07-07, 20:00 #1 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 2×37×61 Posts YAFU as a calculator? Quick question: If I'm in YAFU and enter something like 338^53, I get a value, but from the command line, if I enter ./yafu 338^53 (with or without quotes), it starts factoring. Is there a way to just get the value from the command line? I'm actually looking for a manner to use YAFU within a Bash script to get values that are too large for the calculator..
 2021-07-07, 20:13 #2 bsquared     "Ben" Feb 2007 3,617 Posts Yes, the "expression" function. Some time ago I decided that factor() should be yafu's default action and added this function for just this reason. Code: ./yafu "expr(338^53)" It prints the answer to stdout like so: Code: ans = 107791648724516899391794749922437879901663656637741542210620810142348006207593399220450871624756179567322798904744723676640112990486528 hopefully you can use that. Last fiddled with by bsquared on 2021-07-07 at 20:15 Reason: output
 2021-07-07, 21:24 #3 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 2·37·61 Posts Thanks Ben, This is exactly what I want. And, the -silent option works perfectly for providing just the value, so I won't have to parse.

 Similar Threads Thread Thread Starter Forum Replies Last Post drmurat Aliquot Sequences 7 2020-07-01 09:28 MattcAnderson Lounge 0 2019-10-29 05:19 EdH YAFU 8 2018-03-14 17:22 swl551 Software 0 2012-12-04 17:49 Primeinator Lounge 7 2006-02-16 23:11

All times are UTC. The time now is 01:11.

Sat May 28 01:11:09 UTC 2022 up 43 days, 23:12, 0 users, load averages: 1.62, 1.65, 1.66